home *** CD-ROM | disk | FTP | other *** search
/ Transformers: Revenge of …he Game: Press Kit (USA) / Transformers - Revenge of the Fallen - The Game - Press Kit (USA).bin / Transformers.swf / scripts / fl / video / UIManager.as < prev    next >
Text File  |  2009-06-19  |  176KB  |  4,277 lines

  1. package fl.video
  2. {
  3.    import flash.accessibility.Accessibility;
  4.    import flash.accessibility.AccessibilityProperties;
  5.    import flash.display.Bitmap;
  6.    import flash.display.BitmapData;
  7.    import flash.display.DisplayObject;
  8.    import flash.display.DisplayObjectContainer;
  9.    import flash.display.InteractiveObject;
  10.    import flash.display.Loader;
  11.    import flash.display.Sprite;
  12.    import flash.display.StageAlign;
  13.    import flash.display.StageDisplayState;
  14.    import flash.display.StageScaleMode;
  15.    import flash.events.ErrorEvent;
  16.    import flash.events.Event;
  17.    import flash.events.FocusEvent;
  18.    import flash.events.FullScreenEvent;
  19.    import flash.events.IOErrorEvent;
  20.    import flash.events.KeyboardEvent;
  21.    import flash.events.MouseEvent;
  22.    import flash.events.SecurityErrorEvent;
  23.    import flash.events.TimerEvent;
  24.    import flash.geom.ColorTransform;
  25.    import flash.geom.Matrix;
  26.    import flash.geom.Rectangle;
  27.    import flash.net.URLRequest;
  28.    import flash.system.Capabilities;
  29.    import flash.ui.Keyboard;
  30.    import flash.utils.Dictionary;
  31.    import flash.utils.Timer;
  32.    import flash.utils.getDefinitionByName;
  33.    import flash.utils.getQualifiedClassName;
  34.    import flash.utils.getTimer;
  35.    
  36.    use namespace flvplayback_internal;
  37.    
  38.    public class UIManager
  39.    {
  40.       
  41.       public static const VOLUME_BAR_HIT:int = 12;
  42.       
  43.       flvplayback_internal static var layoutNameToIndexMappings:Object = null;
  44.       
  45.       public static const MUTE_OFF_BUTTON:int = 10;
  46.       
  47.       flvplayback_internal static var buttonSkinLinkageIDs:Array = ["upLinkageID","overLinkageID","downLinkageID"];
  48.       
  49.       public static const BACK_BUTTON:int = 5;
  50.       
  51.       flvplayback_internal static var layoutNameArray:Array = ["pause_mc","play_mc","stop_mc",null,null,"back_mc","forward_mc",null,null,null,null,null,null,"playpause_mc","fullScreenToggle_mc","volumeMute_mc","bufferingBar_mc","seekBar_mc","volumeBar_mc","seekBarHandle_mc","seekBarHit_mc","seekBarProgress_mc","seekBarFullness_mc","volumeBarHandle_mc","volumeBarHit_mc","volumeBarProgress_mc","volumeBarFullness_mc","progressFill_mc"];
  52.       
  53.       public static const FORWARD_BUTTON:int = 6;
  54.       
  55.       public static const STOP_BUTTON:int = 2;
  56.       
  57.       public static const NUM_BUTTONS:int = 13;
  58.       
  59.       public static const NORMAL_STATE:uint = 0;
  60.       
  61.       public static const SEEK_BAR_HANDLE:int = 3;
  62.       
  63.       public static const PLAY_BUTTON:int = 1;
  64.       
  65.       public static const MUTE_BUTTON:int = 15;
  66.       
  67.       public static const DOWN_STATE:uint = 2;
  68.       
  69.       public static const SEEK_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 5;
  70.       
  71.       public static const FULL_SCREEN_OFF_BUTTON:int = 8;
  72.       
  73.       flvplayback_internal static const SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT:Number = 3000;
  74.       
  75.       public static const SEEK_BAR:int = 17;
  76.       
  77.       public static const VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 0;
  78.       
  79.       public static const FULL_SCREEN_ON_BUTTON:int = 7;
  80.       
  81.       public static const SHOW_CONTROLS_BUTTON:Number = 30;
  82.       
  83.       public static const FULL_SCREEN_BUTTON:int = 14;
  84.       
  85.       public static const BUFFERING_BAR:int = 16;
  86.       
  87.       public static const VERSION:String = "2.1.0.19";
  88.       
  89.       public static const VOLUME_BAR_HANDLE:int = 11;
  90.       
  91.       public static const PAUSE_BUTTON:int = 0;
  92.       
  93.       flvplayback_internal static const SKIN_AUTO_HIDE_INTERVAL:Number = 200;
  94.       
  95.       public static const CAPTIONS_ON_BUTTON:Number = 28;
  96.       
  97.       public static const OVER_STATE:uint = 1;
  98.       
  99.       flvplayback_internal static const SKIN_FADING_INTERVAL:Number = 100;
  100.       
  101.       public static const VOLUME_BAR:int = 18;
  102.       
  103.       public static const CAPTIONS_OFF_BUTTON:Number = 29;
  104.       
  105.       public static const SHORT_VERSION:String = "2.1";
  106.       
  107.       public static const SEEK_BAR_INTERVAL_DEFAULT:Number = 250;
  108.       
  109.       flvplayback_internal static var skinClassPrefixes:Array = ["pauseButton","playButton","stopButton",null,null,"backButton","forwardButton","fullScreenButtonOn","fullScreenButtonOff","muteButtonOn","muteButtonOff",null,null,null,null,null,"bufferingBar","seekBar","volumeBar"];
  110.       
  111.       flvplayback_internal static const SKIN_FADING_MAX_TIME_DEFAULT:Number = 500;
  112.       
  113.       public static const SEEK_BAR_HIT:int = 4;
  114.       
  115.       public static const PLAY_PAUSE_BUTTON:int = 13;
  116.       
  117.       public static const BUFFERING_DELAY_INTERVAL_DEFAULT:Number = 1000;
  118.       
  119.       flvplayback_internal static var customComponentClassNames:Array = ["PauseButton","PlayButton","StopButton",null,null,"BackButton","ForwardButton",null,null,null,null,null,null,"PlayPauseButton","FullScreenButton","MuteButton","BufferingBar","SeekBar","VolumeBar"];
  120.       
  121.       public static const MUTE_ON_BUTTON:int = 9;
  122.       
  123.       public static const HIDE_CONTROLS_BUTTON:Number = 31;
  124.       
  125.       public static const FULL_SCREEN_SOURCE_RECT_MIN_HEIGHT:uint = 240;
  126.       
  127.       public static const NUM_CONTROLS:int = 19;
  128.       
  129.       public static const VOLUME_BAR_INTERVAL_DEFAULT:Number = 250;
  130.       
  131.       public static const FULL_SCREEN_SOURCE_RECT_MIN_WIDTH:uint = 320;
  132.        
  133.       
  134.       flvplayback_internal var cacheStageBGColor:uint;
  135.       
  136.       flvplayback_internal var _bufferingDelayTimer:Timer;
  137.       
  138.       public var ctrlDataDict:Dictionary;
  139.       
  140.       flvplayback_internal var _skinAutoHide:Boolean;
  141.       
  142.       flvplayback_internal var placeholderLeft:Number;
  143.       
  144.       flvplayback_internal var _playAfterScrub:Boolean;
  145.       
  146.       public var customClips:Array;
  147.       
  148.       flvplayback_internal var _skinFadeStartTime:int;
  149.       
  150.       flvplayback_internal var delayedControls:Array;
  151.       
  152.       flvplayback_internal var _lastScrubPos:Number;
  153.       
  154.       flvplayback_internal var endTabIndex:int;
  155.       
  156.       flvplayback_internal var _skinAutoHideLastMotionTime:int;
  157.       
  158.       flvplayback_internal var _volumeBarTimer:Timer;
  159.       
  160.       flvplayback_internal var cacheFLVPlaybackScaleMode:Array;
  161.       
  162.       flvplayback_internal var borderScale9Rects:Array;
  163.       
  164.       flvplayback_internal var _volumeBarScrubTolerance:Number;
  165.       
  166.       flvplayback_internal var fullScreenSourceRectMinAspectRatio:Number;
  167.       
  168.       flvplayback_internal var _skin:String;
  169.       
  170.       flvplayback_internal var fullScreenSourceRectMinHeight:uint;
  171.       
  172.       flvplayback_internal var _bufferingBarHides:Boolean;
  173.       
  174.       flvplayback_internal var videoRight:Number;
  175.       
  176.       flvplayback_internal var placeholderRight:Number;
  177.       
  178.       flvplayback_internal var cachedSoundLevel:Number;
  179.       
  180.       flvplayback_internal var videoBottom:Number;
  181.       
  182.       flvplayback_internal var border_mc:DisplayObject;
  183.       
  184.       flvplayback_internal var _skinFadingTimer:Timer;
  185.       
  186.       flvplayback_internal var borderAlpha:Number;
  187.       
  188.       flvplayback_internal var borderColorTransform:ColorTransform;
  189.       
  190.       flvplayback_internal var borderColor:uint;
  191.       
  192.       flvplayback_internal var __visible:Boolean;
  193.       
  194.       flvplayback_internal var cacheFLVPlaybackLocation:Rectangle;
  195.       
  196.       flvplayback_internal var cacheFLVPlaybackIndex:int;
  197.       
  198.       flvplayback_internal var _skinReady:Boolean;
  199.       
  200.       flvplayback_internal var hitTarget_mc:Sprite;
  201.       
  202.       flvplayback_internal var controls:Array;
  203.       
  204.       flvplayback_internal var cacheFLVPlaybackAlign:Array;
  205.       
  206.       flvplayback_internal var startTabIndex:int;
  207.       
  208.       flvplayback_internal var _skinAutoHideMouseX:Number;
  209.       
  210.       flvplayback_internal var _skinAutoHideMouseY:Number;
  211.       
  212.       flvplayback_internal var layout_mc:Sprite;
  213.       
  214.       flvplayback_internal var cacheSkinAutoHide:Boolean;
  215.       
  216.       flvplayback_internal var cacheStageScaleMode:String;
  217.       
  218.       flvplayback_internal var videoTop:Number;
  219.       
  220.       flvplayback_internal var _skinFadingMaxTime:int;
  221.       
  222.       flvplayback_internal var placeholderTop:Number;
  223.       
  224.       flvplayback_internal var focusRect:Boolean = true;
  225.       
  226.       flvplayback_internal var _lastVolumePos:Number;
  227.       
  228.       flvplayback_internal var mouseCaptureCtrl:int;
  229.       
  230.       flvplayback_internal var _seekBarScrubTolerance:Number;
  231.       
  232.       flvplayback_internal var borderPrevRect:Rectangle;
  233.       
  234.       flvplayback_internal var skinTemplate:Sprite;
  235.       
  236.       flvplayback_internal var _progressPercent:Number;
  237.       
  238.       flvplayback_internal var videoLeft:Number;
  239.       
  240.       flvplayback_internal var _fullScreenVideoWidth:Number;
  241.       
  242.       flvplayback_internal var _isMuted:Boolean;
  243.       
  244.       flvplayback_internal var _skinAutoHideTimer:Timer;
  245.       
  246.       flvplayback_internal var _fullScreenBgColor:uint;
  247.       
  248.       flvplayback_internal var _vc:FLVPlayback;
  249.       
  250.       flvplayback_internal var _bufferingOn:Boolean;
  251.       
  252.       flvplayback_internal var _seekBarTimer:Timer;
  253.       
  254.       flvplayback_internal var _controlsEnabled:Boolean;
  255.       
  256.       flvplayback_internal var _fullScreen:Boolean;
  257.       
  258.       flvplayback_internal var placeholderBottom:Number;
  259.       
  260.       flvplayback_internal var fullScreenSourceRectMinWidth:uint;
  261.       
  262.       flvplayback_internal var _fullScreenTakeOver:Boolean;
  263.       
  264.       flvplayback_internal var skin_mc:Sprite;
  265.       
  266.       flvplayback_internal var _fullScreenAccel:Boolean;
  267.       
  268.       flvplayback_internal var _fullScreenVideoHeight:Number;
  269.       
  270.       flvplayback_internal var skinLoadDelayCount:uint;
  271.       
  272.       flvplayback_internal var _skinFadingIn:Boolean;
  273.       
  274.       flvplayback_internal var _skinAutoHideMotionTimeout:int;
  275.       
  276.       flvplayback_internal var borderCopy:Sprite;
  277.       
  278.       flvplayback_internal var accessibilityPropertyNames:Array;
  279.       
  280.       flvplayback_internal var cacheStageAlign:String;
  281.       
  282.       flvplayback_internal var cacheFLVPlaybackParent:DisplayObjectContainer;
  283.       
  284.       flvplayback_internal var skinLoader:Loader;
  285.       
  286.       flvplayback_internal var _skinScaleMaximum:Number;
  287.       
  288.       public function UIManager(param1:FLVPlayback)
  289.       {
  290.          var vc:FLVPlayback = param1;
  291.          accessibilityPropertyNames = ["Pause","Play","Stop","Seek Bar",null,"Back","Forward","Go Full Screen","Exit Full Screen","Volume Mute On","Volume Mute Off","Volume",null,null,null,null,"Buffering",null,null,null,null,null,null,null,null,null,null,null,"Captions Off","Captions On","Show Video Player Controls","Hide Video Player Controls"];
  292.          super();
  293.          _vc = vc;
  294.          _skin = null;
  295.          _skinAutoHide = false;
  296.          cacheSkinAutoHide = flvplayback_internal::_skinAutoHide;
  297.          _skinFadingMaxTime = flvplayback_internal::SKIN_FADING_MAX_TIME_DEFAULT;
  298.          _skinAutoHideMotionTimeout = flvplayback_internal::SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT;
  299.          _skinReady = true;
  300.          __visible = false;
  301.          _bufferingBarHides = false;
  302.          _controlsEnabled = true;
  303.          _lastScrubPos = 0;
  304.          _lastVolumePos = 0;
  305.          cachedSoundLevel = flvplayback_internal::_vc.volume;
  306.          _isMuted = false;
  307.          controls = new Array();
  308.          customClips = null;
  309.          ctrlDataDict = new Dictionary(true);
  310.          skin_mc = null;
  311.          skinLoader = null;
  312.          skinTemplate = null;
  313.          layout_mc = null;
  314.          border_mc = null;
  315.          borderCopy = null;
  316.          borderPrevRect = null;
  317.          borderScale9Rects = null;
  318.          borderAlpha = 0.85;
  319.          borderColor = 4697035;
  320.          borderColorTransform = new ColorTransform(0,0,0,0,71,171,203,255 * flvplayback_internal::borderAlpha);
  321.          _seekBarScrubTolerance = SEEK_BAR_SCRUB_TOLERANCE_DEFAULT;
  322.          _volumeBarScrubTolerance = VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT;
  323.          _bufferingOn = false;
  324.          mouseCaptureCtrl = -1;
  325.          _seekBarTimer = new Timer(SEEK_BAR_INTERVAL_DEFAULT);
  326.          flvplayback_internal::_seekBarTimer.addEventListener(TimerEvent.TIMER,flvplayback_internal::seekBarListener);
  327.          _volumeBarTimer = new Timer(VOLUME_BAR_INTERVAL_DEFAULT);
  328.          flvplayback_internal::_volumeBarTimer.addEventListener(TimerEvent.TIMER,flvplayback_internal::volumeBarListener);
  329.          _bufferingDelayTimer = new Timer(BUFFERING_DELAY_INTERVAL_DEFAULT,1);
  330.          flvplayback_internal::_bufferingDelayTimer.addEventListener(TimerEvent.TIMER,flvplayback_internal::doBufferingDelay);
  331.          _skinAutoHideTimer = new Timer(flvplayback_internal::SKIN_AUTO_HIDE_INTERVAL);
  332.          flvplayback_internal::_skinAutoHideTimer.addEventListener(TimerEvent.TIMER,flvplayback_internal::skinAutoHideHitTest);
  333.          _skinFadingTimer = new Timer(flvplayback_internal::SKIN_FADING_INTERVAL);
  334.          flvplayback_internal::_skinFadingTimer.addEventListener(TimerEvent.TIMER,flvplayback_internal::skinFadeMore);
  335.          flvplayback_internal::_vc.addEventListener(MetadataEvent.METADATA_RECEIVED,flvplayback_internal::handleIVPEvent);
  336.          flvplayback_internal::_vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE,flvplayback_internal::handleIVPEvent);
  337.          flvplayback_internal::_vc.addEventListener(VideoProgressEvent.PROGRESS,flvplayback_internal::handleIVPEvent);
  338.          flvplayback_internal::_vc.addEventListener(VideoEvent.STATE_CHANGE,flvplayback_internal::handleIVPEvent);
  339.          flvplayback_internal::_vc.addEventListener(VideoEvent.READY,flvplayback_internal::handleIVPEvent);
  340.          flvplayback_internal::_vc.addEventListener(LayoutEvent.LAYOUT,flvplayback_internal::handleLayoutEvent);
  341.          flvplayback_internal::_vc.addEventListener(AutoLayoutEvent.AUTO_LAYOUT,flvplayback_internal::handleLayoutEvent);
  342.          flvplayback_internal::_vc.addEventListener(SoundEvent.SOUND_UPDATE,flvplayback_internal::handleSoundEvent);
  343.          flvplayback_internal::_vc.addEventListener(Event.ADDED_TO_STAGE,flvplayback_internal::handleEvent);
  344.          flvplayback_internal::_vc.addEventListener(Event.REMOVED_FROM_STAGE,flvplayback_internal::handleEvent);
  345.          fullScreenSourceRectMinWidth = FULL_SCREEN_SOURCE_RECT_MIN_WIDTH;
  346.          fullScreenSourceRectMinHeight = FULL_SCREEN_SOURCE_RECT_MIN_HEIGHT;
  347.          fullScreenSourceRectMinAspectRatio = FULL_SCREEN_SOURCE_RECT_MIN_WIDTH / FULL_SCREEN_SOURCE_RECT_MIN_HEIGHT;
  348.          _fullScreen = false;
  349.          _fullScreenTakeOver = true;
  350.          _fullScreenBgColor = 0;
  351.          _fullScreenAccel = false;
  352.          if(flvplayback_internal::_vc.stage != null)
  353.          {
  354.             flvplayback_internal::_vc.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE,handleMouseFocusChangeEvent);
  355.             try
  356.             {
  357.                _fullScreen = flvplayback_internal::_vc.stage.displayState == StageDisplayState.FULL_SCREEN;
  358.                flvplayback_internal::_vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  359.             }
  360.             catch(se:SecurityError)
  361.             {
  362.             }
  363.          }
  364.          if(flvplayback_internal::layoutNameToIndexMappings == null)
  365.          {
  366.             initLayoutNameToIndexMappings();
  367.          }
  368.       }
  369.       
  370.       flvplayback_internal static function getNumberPropSafe(param1:Object, param2:String) : Number
  371.       {
  372.          var numProp:* = undefined;
  373.          var obj:Object = param1;
  374.          var propName:String = param2;
  375.          try
  376.          {
  377.             numProp = obj[propName];
  378.             return Number(numProp);
  379.          }
  380.          catch(re:ReferenceError)
  381.          {
  382.             return NaN;
  383.          }
  384.       }
  385.       
  386.       flvplayback_internal static function getBooleanPropSafe(param1:Object, param2:String) : Boolean
  387.       {
  388.          var boolProp:* = undefined;
  389.          var obj:Object = param1;
  390.          var propName:String = param2;
  391.          try
  392.          {
  393.             boolProp = obj[propName];
  394.             return Boolean(boolProp);
  395.          }
  396.          catch(re:ReferenceError)
  397.          {
  398.             return false;
  399.          }
  400.       }
  401.       
  402.       flvplayback_internal static function initLayoutNameToIndexMappings() : void
  403.       {
  404.          layoutNameToIndexMappings = new Object();
  405.          var _loc1_:int = 0;
  406.          while(_loc1_ < flvplayback_internal::layoutNameArray.length)
  407.          {
  408.             if(flvplayback_internal::layoutNameArray[_loc1_] != null)
  409.             {
  410.                flvplayback_internal::layoutNameToIndexMappings[flvplayback_internal::layoutNameArray[_loc1_]] = _loc1_;
  411.             }
  412.             _loc1_++;
  413.          }
  414.       }
  415.       
  416.       public function get seekBarScrubTolerance() : Number
  417.       {
  418.          return flvplayback_internal::_seekBarScrubTolerance;
  419.       }
  420.       
  421.       flvplayback_internal function removeButtonListeners(param1:Sprite) : void
  422.       {
  423.          if(param1 == null)
  424.          {
  425.             return;
  426.          }
  427.          param1.removeEventListener(MouseEvent.ROLL_OVER,flvplayback_internal::handleButtonEvent);
  428.          param1.removeEventListener(MouseEvent.ROLL_OUT,flvplayback_internal::handleButtonEvent);
  429.          param1.removeEventListener(MouseEvent.MOUSE_DOWN,flvplayback_internal::handleButtonEvent);
  430.          param1.removeEventListener(MouseEvent.CLICK,flvplayback_internal::handleButtonEvent);
  431.          param1.removeEventListener(Event.ENTER_FRAME,flvplayback_internal::skinButtonControl);
  432.       }
  433.       
  434.       public function set skinFadeTime(param1:int) : void
  435.       {
  436.          _skinFadingMaxTime = param1;
  437.       }
  438.       
  439.       public function get skinFadeTime() : int
  440.       {
  441.          return flvplayback_internal::_skinFadingMaxTime;
  442.       }
  443.       
  444.       flvplayback_internal function finishLoad(param1:Event) : void
  445.       {
  446.          var i:int = 0;
  447.          var cachedActivePlayerIndex:int = 0;
  448.          var state:String = null;
  449.          var j:int = 0;
  450.          var e:Event = param1;
  451.          try
  452.          {
  453.             ++skinLoadDelayCount;
  454.             if(flvplayback_internal::skinLoadDelayCount < 2)
  455.             {
  456.                return;
  457.             }
  458.             flvplayback_internal::_vc.removeEventListener(Event.ENTER_FRAME,flvplayback_internal::finishLoad);
  459.             focusRect = isFocusRectActive();
  460.             i = 0;
  461.             while(i < NUM_CONTROLS)
  462.             {
  463.                if(flvplayback_internal::delayedControls[i] != undefined)
  464.                {
  465.                   setControl(i,flvplayback_internal::delayedControls[i]);
  466.                }
  467.                i++;
  468.             }
  469.             if(flvplayback_internal::_fullScreenTakeOver)
  470.             {
  471.                enterFullScreenTakeOver();
  472.             }
  473.             else
  474.             {
  475.                exitFullScreenTakeOver();
  476.             }
  477.             layoutSkin();
  478.             setupSkinAutoHide(false);
  479.             flvplayback_internal::skin_mc.visible = flvplayback_internal::__visible;
  480.             flvplayback_internal::_vc.addChild(flvplayback_internal::skin_mc);
  481.             _skinReady = true;
  482.             flvplayback_internal::_vc.skinLoaded();
  483.             cachedActivePlayerIndex = flvplayback_internal::_vc.activeVideoPlayerIndex;
  484.             flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  485.             state = flvplayback_internal::_vc.state;
  486.             j = 0;
  487.             while(j < NUM_CONTROLS)
  488.             {
  489.                if(flvplayback_internal::controls[j] != undefined)
  490.                {
  491.                   setEnabledAndVisibleForState(j,state);
  492.                   if(j < NUM_BUTTONS)
  493.                   {
  494.                      skinButtonControl(flvplayback_internal::controls[j]);
  495.                   }
  496.                }
  497.                j++;
  498.             }
  499.             flvplayback_internal::_vc.activeVideoPlayerIndex = cachedActivePlayerIndex;
  500.          }
  501.          catch(err:Error)
  502.          {
  503.             flvplayback_internal::_vc.skinError(err.message);
  504.             removeSkin();
  505.          }
  506.       }
  507.       
  508.       flvplayback_internal function downloadSkin() : void
  509.       {
  510.          if(flvplayback_internal::skinLoader == null)
  511.          {
  512.             skinLoader = new Loader();
  513.             flvplayback_internal::skinLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,flvplayback_internal::handleLoad);
  514.             flvplayback_internal::skinLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,flvplayback_internal::handleLoadErrorEvent);
  515.             flvplayback_internal::skinLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,flvplayback_internal::handleLoadErrorEvent);
  516.          }
  517.          flvplayback_internal::skinLoader.load(new URLRequest(flvplayback_internal::_skin));
  518.       }
  519.       
  520.       flvplayback_internal function removeSkin() : void
  521.       {
  522.          var i:int = 0;
  523.          if(flvplayback_internal::skinLoader != null)
  524.          {
  525.             try
  526.             {
  527.                flvplayback_internal::skinLoader.close();
  528.             }
  529.             catch(e1:Error)
  530.             {
  531.             }
  532.             skinLoader = null;
  533.          }
  534.          if(flvplayback_internal::skin_mc != null)
  535.          {
  536.             i = 0;
  537.             while(i < NUM_CONTROLS)
  538.             {
  539.                if(flvplayback_internal::controls[i] != undefined)
  540.                {
  541.                   if(i < NUM_BUTTONS)
  542.                   {
  543.                      removeButtonListeners(flvplayback_internal::controls[i]);
  544.                   }
  545.                   delete ctrlDataDict[flvplayback_internal::controls[i]];
  546.                   delete flvplayback_internal::controls[i];
  547.                }
  548.                i++;
  549.             }
  550.             try
  551.             {
  552.                flvplayback_internal::skin_mc.parent.removeChild(flvplayback_internal::skin_mc);
  553.             }
  554.             catch(e2:Error)
  555.             {
  556.             }
  557.             skin_mc = null;
  558.          }
  559.          skinTemplate = null;
  560.          layout_mc = null;
  561.          border_mc = null;
  562.          borderCopy = null;
  563.          borderPrevRect = null;
  564.          borderScale9Rects = null;
  565.       }
  566.       
  567.       flvplayback_internal function positionBar(param1:Sprite, param2:String, param3:Number) : void
  568.       {
  569.          var ctrl:Sprite = param1;
  570.          var type:String = param2;
  571.          var percent:Number = param3;
  572.          try
  573.          {
  574.             if(ctrl["positionBar"] is Function && ctrl["positionBar"](type,percent))
  575.             {
  576.                return;
  577.             }
  578.          }
  579.          catch(re2:ReferenceError)
  580.          {
  581.          }
  582.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  583.          var bar:DisplayObject = ctrlData[type + "_mc"];
  584.          if(bar == null)
  585.          {
  586.             return;
  587.          }
  588.          var barData:ControlData = ctrlDataDict[bar];
  589.          if(bar.parent == ctrl)
  590.          {
  591.             if(barData.fill_mc == null)
  592.             {
  593.                bar.scaleX = barData.origScaleX * percent / 100;
  594.             }
  595.             else
  596.             {
  597.                positionMaskedFill(bar,percent);
  598.             }
  599.          }
  600.          else
  601.          {
  602.             bar.x = ctrl.x + barData.leftMargin;
  603.             bar.y = ctrl.y + barData.origY;
  604.             if(barData.fill_mc == null)
  605.             {
  606.                bar.width = (ctrl.width - barData.leftMargin - barData.rightMargin) * percent / 100;
  607.             }
  608.             else
  609.             {
  610.                positionMaskedFill(bar,percent);
  611.             }
  612.          }
  613.       }
  614.       
  615.       flvplayback_internal function setupButtonSkin(param1:int, param2:DisplayObject) : Sprite
  616.       {
  617.          var _loc3_:String = flvplayback_internal::skinClassPrefixes[param1];
  618.          if(_loc3_ == null)
  619.          {
  620.             return null;
  621.          }
  622.          var _loc4_:Sprite = new Sprite();
  623.          var _loc5_:ControlData = new ControlData(this,_loc4_,null,param1);
  624.          ctrlDataDict[_loc4_] = _loc5_;
  625.          _loc5_.state_mc = new Array();
  626.          _loc5_.state_mc[NORMAL_STATE] = setupButtonSkinState(_loc4_,flvplayback_internal::skinTemplate,_loc3_ + "NormalState");
  627.          _loc5_.state_mc[NORMAL_STATE].visible = true;
  628.          _loc5_.state_mc[OVER_STATE] = setupButtonSkinState(_loc4_,flvplayback_internal::skinTemplate,_loc3_ + "OverState",_loc5_.state_mc[NORMAL_STATE]);
  629.          _loc5_.state_mc[DOWN_STATE] = setupButtonSkinState(_loc4_,flvplayback_internal::skinTemplate,_loc3_ + "DownState",_loc5_.state_mc[NORMAL_STATE]);
  630.          _loc5_.disabled_mc = setupButtonSkinState(_loc4_,flvplayback_internal::skinTemplate,_loc3_ + "DisabledState",_loc5_.state_mc[NORMAL_STATE]);
  631.          if(param2 is InteractiveObject)
  632.          {
  633.             _loc4_.tabIndex = InteractiveObject(param2).tabIndex;
  634.          }
  635.          return _loc4_;
  636.       }
  637.       
  638.       public function get skinReady() : Boolean
  639.       {
  640.          return flvplayback_internal::_skinReady;
  641.       }
  642.       
  643.       public function get skinAutoHide() : Boolean
  644.       {
  645.          return flvplayback_internal::_skinAutoHide;
  646.       }
  647.       
  648.       flvplayback_internal function dispatchMessage(param1:int) : void
  649.       {
  650.          var ctrl:Sprite = null;
  651.          var ctrlData:ControlData = null;
  652.          var handle:Sprite = null;
  653.          var index:int = param1;
  654.          if(index == SEEK_BAR_HANDLE || index == SEEK_BAR_HIT)
  655.          {
  656.             flvplayback_internal::_vc._scrubStart();
  657.          }
  658.          var cachedActivePlayerIndex:int = flvplayback_internal::_vc.activeVideoPlayerIndex;
  659.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  660.          switch(index)
  661.          {
  662.             case PAUSE_BUTTON:
  663.                flvplayback_internal::_vc.pause();
  664.                break;
  665.             case PLAY_BUTTON:
  666.                flvplayback_internal::_vc.play();
  667.                break;
  668.             case STOP_BUTTON:
  669.                flvplayback_internal::_vc.stop();
  670.                break;
  671.             case SEEK_BAR_HIT:
  672.             case SEEK_BAR_HANDLE:
  673.                ctrl = flvplayback_internal::controls[SEEK_BAR];
  674.                ctrlData = ctrlDataDict[ctrl];
  675.                calcPercentageFromHandle(ctrl);
  676.                _lastScrubPos = ctrlData.percentage;
  677.                if(index == SEEK_BAR_HIT)
  678.                {
  679.                   handle = flvplayback_internal::controls[SEEK_BAR_HANDLE];
  680.                   handle.x = handle.parent.mouseX;
  681.                   handle.y = handle.parent.mouseY;
  682.                }
  683.                flvplayback_internal::_vc.removeEventListener(VideoEvent.PLAYHEAD_UPDATE,flvplayback_internal::handleIVPEvent);
  684.                if(flvplayback_internal::_vc.playing || flvplayback_internal::_vc.buffering)
  685.                {
  686.                   _playAfterScrub = true;
  687.                }
  688.                else if(flvplayback_internal::_vc.state != VideoState.SEEKING)
  689.                {
  690.                   _playAfterScrub = false;
  691.                }
  692.                flvplayback_internal::_seekBarTimer.start();
  693.                startHandleDrag(ctrl);
  694.                flvplayback_internal::_vc.pause();
  695.                break;
  696.             case VOLUME_BAR_HIT:
  697.             case VOLUME_BAR_HANDLE:
  698.                ctrl = flvplayback_internal::controls[VOLUME_BAR];
  699.                ctrlData = ctrlDataDict[ctrl];
  700.                calcPercentageFromHandle(ctrl);
  701.                _lastVolumePos = ctrlData.percentage;
  702.                if(index == VOLUME_BAR_HIT)
  703.                {
  704.                   handle = flvplayback_internal::controls[VOLUME_BAR_HANDLE];
  705.                   handle.x = handle.parent.mouseX;
  706.                   handle.y = handle.parent.mouseY;
  707.                }
  708.                flvplayback_internal::_vc.removeEventListener(SoundEvent.SOUND_UPDATE,flvplayback_internal::handleSoundEvent);
  709.                flvplayback_internal::_volumeBarTimer.start();
  710.                startHandleDrag(ctrl);
  711.                break;
  712.             case BACK_BUTTON:
  713.                flvplayback_internal::_vc.seekToPrevNavCuePoint();
  714.                break;
  715.             case FORWARD_BUTTON:
  716.                flvplayback_internal::_vc.seekToNextNavCuePoint();
  717.                break;
  718.             case MUTE_ON_BUTTON:
  719.                if(!flvplayback_internal::_isMuted)
  720.                {
  721.                   _isMuted = true;
  722.                   cachedSoundLevel = flvplayback_internal::_vc.volume;
  723.                   flvplayback_internal::_vc.volume = 0;
  724.                   setEnabledAndVisibleForState(MUTE_OFF_BUTTON,VideoState.PLAYING);
  725.                   skinButtonControl(flvplayback_internal::controls[MUTE_OFF_BUTTON]);
  726.                   setEnabledAndVisibleForState(MUTE_ON_BUTTON,VideoState.PLAYING);
  727.                   skinButtonControl(flvplayback_internal::controls[MUTE_ON_BUTTON]);
  728.                }
  729.                break;
  730.             case MUTE_OFF_BUTTON:
  731.                if(flvplayback_internal::_isMuted)
  732.                {
  733.                   _isMuted = false;
  734.                   flvplayback_internal::_vc.volume = flvplayback_internal::cachedSoundLevel;
  735.                   setEnabledAndVisibleForState(MUTE_OFF_BUTTON,VideoState.PLAYING);
  736.                   skinButtonControl(flvplayback_internal::controls[MUTE_OFF_BUTTON]);
  737.                   setEnabledAndVisibleForState(MUTE_ON_BUTTON,VideoState.PLAYING);
  738.                   skinButtonControl(flvplayback_internal::controls[MUTE_ON_BUTTON]);
  739.                }
  740.                break;
  741.             case FULL_SCREEN_ON_BUTTON:
  742.                if(!flvplayback_internal::_fullScreen && flvplayback_internal::_vc.stage != null)
  743.                {
  744.                   enterFullScreenDisplayState();
  745.                   setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON,VideoState.PLAYING);
  746.                   skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_OFF_BUTTON]);
  747.                   setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON,VideoState.PLAYING);
  748.                   skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_ON_BUTTON]);
  749.                }
  750.                break;
  751.             case FULL_SCREEN_OFF_BUTTON:
  752.                if(flvplayback_internal::_fullScreen && flvplayback_internal::_vc.stage != null)
  753.                {
  754.                   try
  755.                   {
  756.                      flvplayback_internal::_vc.stage.displayState = StageDisplayState.NORMAL;
  757.                   }
  758.                   catch(se:SecurityError)
  759.                   {
  760.                   }
  761.                   setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON,VideoState.PLAYING);
  762.                   skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_OFF_BUTTON]);
  763.                   setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON,VideoState.PLAYING);
  764.                   skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_ON_BUTTON]);
  765.                }
  766.                break;
  767.             default:
  768.                throw new Error("Unknown ButtonControl");
  769.          }
  770.          flvplayback_internal::_vc.activeVideoPlayerIndex = cachedActivePlayerIndex;
  771.       }
  772.       
  773.       flvplayback_internal function handleFullScreenEvent(param1:FullScreenEvent) : void
  774.       {
  775.          _fullScreen = param1.fullScreen;
  776.          setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON,VideoState.PLAYING);
  777.          skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_OFF_BUTTON]);
  778.          setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON,VideoState.PLAYING);
  779.          skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_ON_BUTTON]);
  780.          if(flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenTakeOver)
  781.          {
  782.             enterFullScreenTakeOver();
  783.          }
  784.          else if(!flvplayback_internal::_fullScreen)
  785.          {
  786.             exitFullScreenTakeOver();
  787.          }
  788.       }
  789.       
  790.       flvplayback_internal function handleLayoutEvent(param1:LayoutEvent) : void
  791.       {
  792.          var _loc2_:int = 0;
  793.          if(flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenTakeOver && flvplayback_internal::_fullScreenAccel && flvplayback_internal::_vc.stage != null)
  794.          {
  795.             if(flvplayback_internal::_vc.registrationX != 0 || flvplayback_internal::_vc.registrationY != 0 || flvplayback_internal::_vc.parent != flvplayback_internal::_vc.stage || flvplayback_internal::_vc.registrationWidth != flvplayback_internal::_vc.stage.stageWidth || flvplayback_internal::_vc.registrationHeight != flvplayback_internal::_vc.stage.stageHeight)
  796.             {
  797.                flvplayback_internal::_vc.stage.displayState = StageDisplayState.NORMAL;
  798.                return;
  799.             }
  800.             _loc2_ = flvplayback_internal::_vc.activeVideoPlayerIndex;
  801.             flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  802.             if(flvplayback_internal::_vc.align != VideoAlign.CENTER)
  803.             {
  804.                flvplayback_internal::cacheFLVPlaybackAlign[flvplayback_internal::_vc.visibleVideoPlayerIndex] = flvplayback_internal::_vc.align;
  805.                flvplayback_internal::_vc.align = VideoAlign.CENTER;
  806.             }
  807.             if(flvplayback_internal::_vc.scaleMode != VideoScaleMode.MAINTAIN_ASPECT_RATIO)
  808.             {
  809.                flvplayback_internal::cacheFLVPlaybackScaleMode[flvplayback_internal::_vc.visibleVideoPlayerIndex] = flvplayback_internal::_vc.scaleMode;
  810.                flvplayback_internal::_vc.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
  811.                flvplayback_internal::_vc.activeVideoPlayerIndex = _loc2_;
  812.                return;
  813.             }
  814.             flvplayback_internal::_vc.activeVideoPlayerIndex = _loc2_;
  815.          }
  816.          layoutSkin();
  817.          setupSkinAutoHide(false);
  818.       }
  819.       
  820.       flvplayback_internal function seekBarListener(param1:TimerEvent) : void
  821.       {
  822.          var _loc2_:int = flvplayback_internal::_vc.activeVideoPlayerIndex;
  823.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  824.          var _loc3_:Sprite = flvplayback_internal::controls[SEEK_BAR];
  825.          if(_loc3_ == null)
  826.          {
  827.             return;
  828.          }
  829.          var _loc4_:ControlData = ctrlDataDict[_loc3_];
  830.          calcPercentageFromHandle(_loc3_);
  831.          var _loc5_:Number = _loc4_.percentage;
  832.          if(param1 == null)
  833.          {
  834.             flvplayback_internal::_seekBarTimer.stop();
  835.             if(_loc5_ != flvplayback_internal::_lastScrubPos)
  836.             {
  837.                flvplayback_internal::_vc.seekPercent(_loc5_);
  838.             }
  839.             flvplayback_internal::_vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE,flvplayback_internal::handleIVPEvent);
  840.             if(flvplayback_internal::_playAfterScrub)
  841.             {
  842.                flvplayback_internal::_vc.play();
  843.             }
  844.          }
  845.          else if(flvplayback_internal::_vc.getVideoPlayer(flvplayback_internal::_vc.visibleVideoPlayerIndex).state != VideoState.SEEKING)
  846.          {
  847.             if(flvplayback_internal::_seekBarScrubTolerance <= 0 || Math.abs(_loc5_ - flvplayback_internal::_lastScrubPos) > flvplayback_internal::_seekBarScrubTolerance || _loc5_ < flvplayback_internal::_seekBarScrubTolerance || _loc5_ > 100 - flvplayback_internal::_seekBarScrubTolerance)
  848.             {
  849.                if(_loc5_ != flvplayback_internal::_lastScrubPos)
  850.                {
  851.                   _lastScrubPos = _loc5_;
  852.                   flvplayback_internal::_vc.seekPercent(_loc5_);
  853.                }
  854.             }
  855.          }
  856.          flvplayback_internal::_vc.activeVideoPlayerIndex = _loc2_;
  857.       }
  858.       
  859.       private function handleMouseFocusChangeEvent(param1:FocusEvent) : void
  860.       {
  861.          var ctrlData:ControlData = null;
  862.          var focusCtrlData:ControlData = null;
  863.          var ctrl:Sprite = null;
  864.          var setFocusedControl:Function = null;
  865.          var event:FocusEvent = param1;
  866.          try
  867.          {
  868.             ctrlData = ctrlDataDict[event.relatedObject];
  869.          }
  870.          catch(error:ReferenceError)
  871.          {
  872.          }
  873.          if(ctrlData == null)
  874.          {
  875.             return;
  876.          }
  877.          var index:int = ctrlData.index;
  878.          var currentFocus:InteractiveObject = event.target.stage.focus as InteractiveObject;
  879.          var focusControl:InteractiveObject = null;
  880.          switch(index)
  881.          {
  882.             case PLAY_BUTTON:
  883.                focusControl = flvplayback_internal::controls[PAUSE_BUTTON] as InteractiveObject;
  884.                break;
  885.             case PAUSE_BUTTON:
  886.                focusControl = flvplayback_internal::controls[PLAY_BUTTON] as InteractiveObject;
  887.                break;
  888.             case STOP_BUTTON:
  889.             case BACK_BUTTON:
  890.             case FORWARD_BUTTON:
  891.             case SEEK_BAR_HANDLE:
  892.             case VOLUME_BAR_HANDLE:
  893.                focusControl = flvplayback_internal::controls[event.relatedObject] as InteractiveObject;
  894.                break;
  895.             case SEEK_BAR_HIT:
  896.                focusControl = flvplayback_internal::controls[SEEK_BAR_HANDLE] as InteractiveObject;
  897.                break;
  898.             case VOLUME_BAR_HIT:
  899.                focusControl = flvplayback_internal::controls[VOLUME_BAR_HANDLE] as InteractiveObject;
  900.                break;
  901.             case MUTE_ON_BUTTON:
  902.                focusControl = flvplayback_internal::controls[MUTE_OFF_BUTTON] as InteractiveObject;
  903.                break;
  904.             case MUTE_OFF_BUTTON:
  905.                focusControl = flvplayback_internal::controls[MUTE_ON_BUTTON] as InteractiveObject;
  906.                break;
  907.             case FULL_SCREEN_ON_BUTTON:
  908.                focusControl = flvplayback_internal::controls[FULL_SCREEN_OFF_BUTTON] as InteractiveObject;
  909.                break;
  910.             case FULL_SCREEN_OFF_BUTTON:
  911.                focusControl = flvplayback_internal::controls[FULL_SCREEN_ON_BUTTON] as InteractiveObject;
  912.          }
  913.          if(focusControl != null)
  914.          {
  915.             try
  916.             {
  917.                focusCtrlData = ctrlDataDict[focusControl];
  918.                focusCtrlData.cachedFocusRect = focusControl.focusRect;
  919.             }
  920.             catch(error:ReferenceError)
  921.             {
  922.             }
  923.             focusControl.focusRect = false;
  924.             if(focusControl.visible)
  925.             {
  926.                focusControl.stage.focus = focusControl;
  927.                focusControl.focusRect = focusCtrlData.cachedFocusRect;
  928.             }
  929.             else
  930.             {
  931.                ctrl = event.currentTarget as Sprite;
  932.                setFocusedControl = function(param1:Event):void
  933.                {
  934.                   if(param1.target.visible)
  935.                   {
  936.                      param1.target.stage.focus = param1.target;
  937.                      param1.target.focusRect = focusCtrlData.cachedFocusRect;
  938.                      param1.target.removeEventListener(Event.ENTER_FRAME,setFocusedControl);
  939.                   }
  940.                };
  941.                focusControl.addEventListener(Event.ENTER_FRAME,setFocusedControl);
  942.             }
  943.          }
  944.       }
  945.       
  946.       public function get seekBarInterval() : Number
  947.       {
  948.          return flvplayback_internal::_seekBarTimer.delay;
  949.       }
  950.       
  951.       public function set skinAutoHide(param1:Boolean) : void
  952.       {
  953.          if(param1 == flvplayback_internal::_skinAutoHide)
  954.          {
  955.             return;
  956.          }
  957.          _skinAutoHide = param1;
  958.          cacheSkinAutoHide = param1;
  959.          setupSkinAutoHide(true);
  960.       }
  961.       
  962.       flvplayback_internal function setCustomClip(param1:DisplayObject) : void
  963.       {
  964.          var scale9Grid:Rectangle = null;
  965.          var diff:Number = NaN;
  966.          var numBorderBitmaps:int = 0;
  967.          var i:int = 0;
  968.          var lastXDim:Number = NaN;
  969.          var floorLastXDim:Number = NaN;
  970.          var lastYDim:Number = NaN;
  971.          var floorLastYDim:Number = NaN;
  972.          var newRect:Rectangle = null;
  973.          var dispObj:DisplayObject = param1;
  974.          var dCopy:DisplayObject = new dispObj["constructor"]();
  975.          flvplayback_internal::skin_mc.addChild(dCopy);
  976.          var ctrlData:ControlData = new ControlData(this,dCopy,null,-1);
  977.          ctrlDataDict[dCopy] = ctrlData;
  978.          ctrlData.avatar = dispObj;
  979.          customClips.push(dCopy);
  980.          dCopy.accessibilityProperties = new AccessibilityProperties();
  981.          dCopy.accessibilityProperties.silent = true;
  982.          if(dispObj.name == "border_mc")
  983.          {
  984.             border_mc = dCopy;
  985.             try
  986.             {
  987.                borderCopy = !!ctrlData.avatar["colorMe"] ? new Sprite() : null;
  988.             }
  989.             catch(re:ReferenceError)
  990.             {
  991.                borderCopy = null;
  992.             }
  993.             if(flvplayback_internal::borderCopy != null)
  994.             {
  995.                flvplayback_internal::border_mc.visible = false;
  996.                scale9Grid = flvplayback_internal::border_mc.scale9Grid;
  997.                scale9Grid.x = Math.round(scale9Grid.x);
  998.                scale9Grid.y = Math.round(scale9Grid.y);
  999.                scale9Grid.width = Math.round(scale9Grid.width);
  1000.                diff = scale9Grid.x + scale9Grid.width - flvplayback_internal::border_mc.scale9Grid.right;
  1001.                if(diff > 0.5)
  1002.                {
  1003.                   --scale9Grid.width;
  1004.                }
  1005.                else if(diff < -0.5)
  1006.                {
  1007.                   ++scale9Grid.width;
  1008.                }
  1009.                scale9Grid.height = Math.round(scale9Grid.height);
  1010.                diff = scale9Grid.y + scale9Grid.height - flvplayback_internal::border_mc.scale9Grid.bottom;
  1011.                if(diff > 0.5)
  1012.                {
  1013.                   --scale9Grid.height;
  1014.                }
  1015.                else if(diff < -0.5)
  1016.                {
  1017.                   ++scale9Grid.height;
  1018.                }
  1019.                if(scale9Grid != null)
  1020.                {
  1021.                   borderScale9Rects = new Array();
  1022.                   lastXDim = flvplayback_internal::border_mc.width - (scale9Grid.x + scale9Grid.width);
  1023.                   floorLastXDim = Math.floor(lastXDim);
  1024.                   if(lastXDim - floorLastXDim < 0.05)
  1025.                   {
  1026.                      lastXDim = floorLastXDim;
  1027.                   }
  1028.                   else
  1029.                   {
  1030.                      lastXDim = floorLastXDim + 1;
  1031.                   }
  1032.                   lastYDim = flvplayback_internal::border_mc.height - (scale9Grid.y + scale9Grid.height);
  1033.                   floorLastYDim = Math.floor(lastYDim);
  1034.                   if(lastYDim - floorLastYDim < 0.05)
  1035.                   {
  1036.                      lastYDim = floorLastYDim;
  1037.                   }
  1038.                   else
  1039.                   {
  1040.                      lastYDim = floorLastYDim + 1;
  1041.                   }
  1042.                   newRect = new Rectangle(0,0,scale9Grid.x,scale9Grid.y);
  1043.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1044.                   newRect = new Rectangle(scale9Grid.x,0,scale9Grid.width,scale9Grid.y);
  1045.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1046.                   newRect = new Rectangle(scale9Grid.x + scale9Grid.width,0,lastXDim,scale9Grid.y);
  1047.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1048.                   newRect = new Rectangle(0,scale9Grid.y,scale9Grid.x,scale9Grid.height);
  1049.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1050.                   newRect = new Rectangle(scale9Grid.x,scale9Grid.y,scale9Grid.width,scale9Grid.height);
  1051.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1052.                   newRect = new Rectangle(scale9Grid.x + scale9Grid.width,scale9Grid.y,lastXDim,scale9Grid.height);
  1053.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1054.                   newRect = new Rectangle(0,scale9Grid.y + scale9Grid.height,scale9Grid.x,lastYDim);
  1055.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1056.                   newRect = new Rectangle(scale9Grid.x,scale9Grid.y + scale9Grid.height,scale9Grid.width,lastYDim);
  1057.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1058.                   newRect = new Rectangle(scale9Grid.x + scale9Grid.width,scale9Grid.y + scale9Grid.height,lastXDim,lastYDim);
  1059.                   flvplayback_internal::borderScale9Rects.push(newRect.width < 1 || newRect.height < 1 ? null : newRect);
  1060.                   i = 0;
  1061.                   while(i < flvplayback_internal::borderScale9Rects.length)
  1062.                   {
  1063.                      if(flvplayback_internal::borderScale9Rects[i] != null)
  1064.                      {
  1065.                         break;
  1066.                      }
  1067.                      i++;
  1068.                   }
  1069.                   if(i >= flvplayback_internal::borderScale9Rects.length)
  1070.                   {
  1071.                      borderScale9Rects = null;
  1072.                   }
  1073.                }
  1074.                numBorderBitmaps = flvplayback_internal::borderScale9Rects == null ? 1 : 9;
  1075.                i = 0;
  1076.                while(i < numBorderBitmaps)
  1077.                {
  1078.                   if(flvplayback_internal::borderScale9Rects == null || flvplayback_internal::borderScale9Rects[i] != null)
  1079.                   {
  1080.                      flvplayback_internal::borderCopy.addChild(new Bitmap());
  1081.                   }
  1082.                   i++;
  1083.                }
  1084.                flvplayback_internal::borderCopy.accessibilityProperties = new AccessibilityProperties();
  1085.                flvplayback_internal::borderCopy.accessibilityProperties.silent = true;
  1086.                flvplayback_internal::skin_mc.addChild(flvplayback_internal::borderCopy);
  1087.                borderPrevRect = null;
  1088.             }
  1089.          }
  1090.       }
  1091.       
  1092.       public function get fullScreenSkinDelay() : int
  1093.       {
  1094.          return flvplayback_internal::_skinAutoHideMotionTimeout;
  1095.       }
  1096.       
  1097.       flvplayback_internal function doBufferingDelay(param1:TimerEvent) : void
  1098.       {
  1099.          flvplayback_internal::_bufferingDelayTimer.reset();
  1100.          var _loc2_:int = flvplayback_internal::_vc.activeVideoPlayerIndex;
  1101.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  1102.          if(flvplayback_internal::_vc.state == VideoState.BUFFERING)
  1103.          {
  1104.             _bufferingOn = true;
  1105.             handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE,false,false,VideoState.BUFFERING,NaN,flvplayback_internal::_vc.visibleVideoPlayerIndex));
  1106.          }
  1107.          flvplayback_internal::_vc.activeVideoPlayerIndex = _loc2_;
  1108.       }
  1109.       
  1110.       flvplayback_internal function volumeBarListener(param1:TimerEvent) : void
  1111.       {
  1112.          var _loc2_:Sprite = flvplayback_internal::controls[VOLUME_BAR];
  1113.          if(_loc2_ == null)
  1114.          {
  1115.             return;
  1116.          }
  1117.          var _loc3_:ControlData = ctrlDataDict[_loc2_];
  1118.          calcPercentageFromHandle(_loc2_);
  1119.          var _loc4_:Number = _loc3_.percentage;
  1120.          var _loc5_:*;
  1121.          if(_loc5_ = param1 == null)
  1122.          {
  1123.             flvplayback_internal::_volumeBarTimer.stop();
  1124.             flvplayback_internal::_vc.addEventListener(SoundEvent.SOUND_UPDATE,flvplayback_internal::handleSoundEvent);
  1125.          }
  1126.          if(_loc5_ || flvplayback_internal::_volumeBarScrubTolerance <= 0 || Math.abs(_loc4_ - flvplayback_internal::_lastVolumePos) > flvplayback_internal::_volumeBarScrubTolerance || _loc4_ < flvplayback_internal::_volumeBarScrubTolerance || _loc4_ > 100 - flvplayback_internal::_volumeBarScrubTolerance)
  1127.          {
  1128.             if(_loc4_ != flvplayback_internal::_lastVolumePos)
  1129.             {
  1130.                if(flvplayback_internal::_isMuted)
  1131.                {
  1132.                   cachedSoundLevel = _loc4_ / 100;
  1133.                }
  1134.                else
  1135.                {
  1136.                   flvplayback_internal::_vc.volume = _loc4_ / 100;
  1137.                }
  1138.                _lastVolumePos = _loc4_;
  1139.             }
  1140.          }
  1141.       }
  1142.       
  1143.       public function get visible() : Boolean
  1144.       {
  1145.          return flvplayback_internal::__visible;
  1146.       }
  1147.       
  1148.       flvplayback_internal function isFocusRectActive() : Boolean
  1149.       {
  1150.          var i:int = 0;
  1151.          var doc:DisplayObjectContainer = null;
  1152.          var child:DisplayObject = null;
  1153.          var classReference:Class = null;
  1154.          var c:* = undefined;
  1155.          var o:InteractiveObject = flvplayback_internal::_vc.parent;
  1156.          while(o)
  1157.          {
  1158.             if(o is DisplayObjectContainer)
  1159.             {
  1160.                doc = DisplayObjectContainer(o);
  1161.             }
  1162.             i = 0;
  1163.             for(; i < doc.numChildren; i++)
  1164.             {
  1165.                try
  1166.                {
  1167.                   child = doc.getChildAt(i) as DisplayObject;
  1168.                   classReference = getDefinitionByName("fl.core.UIComponent") as Class;
  1169.                   if(child != null && child != flvplayback_internal::_vc && child is classReference)
  1170.                   {
  1171.                      c = child as classReference;
  1172.                      if(c.focusManager.showFocusIndicator)
  1173.                      {
  1174.                         return false;
  1175.                      }
  1176.                      break;
  1177.                   }
  1178.                }
  1179.                catch(e:Error)
  1180.                {
  1181.                   continue;
  1182.                }
  1183.             }
  1184.             o = o.parent;
  1185.          }
  1186.          return true;
  1187.       }
  1188.       
  1189.       flvplayback_internal function fixUpBar(param1:DisplayObject, param2:String, param3:DisplayObject, param4:String) : void
  1190.       {
  1191.          var bar:DisplayObject = null;
  1192.          var definitionHolder:DisplayObject = param1;
  1193.          var propPrefix:String = param2;
  1194.          var ctrl:DisplayObject = param3;
  1195.          var name:String = param4;
  1196.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  1197.          if(ctrlData[name] != null)
  1198.          {
  1199.             return;
  1200.          }
  1201.          try
  1202.          {
  1203.             bar = ctrl[name];
  1204.          }
  1205.          catch(re:ReferenceError)
  1206.          {
  1207.             bar = null;
  1208.          }
  1209.          if(bar == null)
  1210.          {
  1211.             try
  1212.             {
  1213.                bar = createSkin(definitionHolder,propPrefix + "LinkageID");
  1214.             }
  1215.             catch(ve:VideoError)
  1216.             {
  1217.                bar = null;
  1218.             }
  1219.             if(bar == null)
  1220.             {
  1221.                return;
  1222.             }
  1223.             if(ctrl.parent != null)
  1224.             {
  1225.                if(getBooleanPropSafe(ctrl,propPrefix + "Below"))
  1226.                {
  1227.                   ctrl.parent.addChildAt(bar,ctrl.parent.getChildIndex(ctrl));
  1228.                }
  1229.                else
  1230.                {
  1231.                   ctrl.parent.addChild(bar);
  1232.                }
  1233.             }
  1234.          }
  1235.          ctrlData[name] = bar;
  1236.          var barData:ControlData = ctrlDataDict[bar];
  1237.          if(barData == null)
  1238.          {
  1239.             barData = new ControlData(this,bar,ctrl,-1);
  1240.             ctrlDataDict[bar] = barData;
  1241.          }
  1242.       }
  1243.       
  1244.       public function get volumeBarInterval() : Number
  1245.       {
  1246.          return flvplayback_internal::_volumeBarTimer.delay;
  1247.       }
  1248.       
  1249.       public function get bufferingBarHidesAndDisablesOthers() : Boolean
  1250.       {
  1251.          return flvplayback_internal::_bufferingBarHides;
  1252.       }
  1253.       
  1254.       flvplayback_internal function calcLayoutControl(param1:DisplayObject) : Rectangle
  1255.       {
  1256.          var ctrl:DisplayObject = param1;
  1257.          var rect:Rectangle = new Rectangle();
  1258.          if(ctrl == null)
  1259.          {
  1260.             return rect;
  1261.          }
  1262.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  1263.          if(ctrlData == null)
  1264.          {
  1265.             return rect;
  1266.          }
  1267.          if(ctrlData.avatar == null)
  1268.          {
  1269.             return rect;
  1270.          }
  1271.          var anchorRight:Boolean = false;
  1272.          var anchorLeft:Boolean = true;
  1273.          var anchorTop:Boolean = false;
  1274.          var anchorBottom:Boolean = true;
  1275.          try
  1276.          {
  1277.             anchorRight = ctrlData.avatar["anchorRight"];
  1278.          }
  1279.          catch(re1:ReferenceError)
  1280.          {
  1281.             anchorRight = false;
  1282.          }
  1283.          try
  1284.          {
  1285.             anchorLeft = ctrlData.avatar["anchorLeft"];
  1286.          }
  1287.          catch(re1:ReferenceError)
  1288.          {
  1289.             anchorLeft = true;
  1290.          }
  1291.          try
  1292.          {
  1293.             anchorTop = ctrlData.avatar["anchorTop"];
  1294.          }
  1295.          catch(re1:ReferenceError)
  1296.          {
  1297.             anchorTop = false;
  1298.          }
  1299.          try
  1300.          {
  1301.             anchorBottom = ctrlData.avatar["anchorBottom"];
  1302.          }
  1303.          catch(re1:ReferenceError)
  1304.          {
  1305.             anchorBottom = true;
  1306.          }
  1307.          if(anchorRight)
  1308.          {
  1309.             if(anchorLeft)
  1310.             {
  1311.                rect.x = ctrlData.avatar.x - flvplayback_internal::placeholderLeft + flvplayback_internal::videoLeft;
  1312.                rect.width = ctrlData.avatar.x + ctrlData.avatar.width - flvplayback_internal::placeholderRight + flvplayback_internal::videoRight - rect.x;
  1313.                ctrlData.origWidth = NaN;
  1314.             }
  1315.             else
  1316.             {
  1317.                rect.x = ctrlData.avatar.x - flvplayback_internal::placeholderRight + flvplayback_internal::videoRight;
  1318.                rect.width = ctrl.width;
  1319.             }
  1320.          }
  1321.          else
  1322.          {
  1323.             rect.x = ctrlData.avatar.x - flvplayback_internal::placeholderLeft + flvplayback_internal::videoLeft;
  1324.             rect.width = ctrl.width;
  1325.          }
  1326.          if(anchorTop)
  1327.          {
  1328.             if(anchorBottom)
  1329.             {
  1330.                rect.y = ctrlData.avatar.y - flvplayback_internal::placeholderTop + flvplayback_internal::videoTop;
  1331.                rect.height = ctrlData.avatar.y + ctrlData.avatar.height - flvplayback_internal::placeholderBottom + flvplayback_internal::videoBottom - rect.y;
  1332.                ctrlData.origHeight = NaN;
  1333.             }
  1334.             else
  1335.             {
  1336.                rect.y = ctrlData.avatar.y - flvplayback_internal::placeholderTop + flvplayback_internal::videoTop;
  1337.                rect.height = ctrl.height;
  1338.             }
  1339.          }
  1340.          else
  1341.          {
  1342.             rect.y = ctrlData.avatar.y - flvplayback_internal::placeholderBottom + flvplayback_internal::videoBottom;
  1343.             rect.height = ctrl.height;
  1344.          }
  1345.          try
  1346.          {
  1347.             if(ctrl["layoutSelf"] is Function)
  1348.             {
  1349.                rect = ctrl["layoutSelf"](rect);
  1350.             }
  1351.          }
  1352.          catch(re3:ReferenceError)
  1353.          {
  1354.          }
  1355.          return rect;
  1356.       }
  1357.       
  1358.       flvplayback_internal function skinFadeMore(param1:TimerEvent) : void
  1359.       {
  1360.          var _loc2_:Number = NaN;
  1361.          if(!flvplayback_internal::_skinFadingIn && flvplayback_internal::skin_mc.alpha <= 0.5 || flvplayback_internal::_skinFadingIn && flvplayback_internal::skin_mc.alpha >= 0.95)
  1362.          {
  1363.             flvplayback_internal::skin_mc.visible = flvplayback_internal::_skinFadingIn;
  1364.             flvplayback_internal::skin_mc.alpha = 1;
  1365.             flvplayback_internal::_skinFadingTimer.stop();
  1366.          }
  1367.          else
  1368.          {
  1369.             _loc2_ = (getTimer() - flvplayback_internal::_skinFadeStartTime) / flvplayback_internal::_skinFadingMaxTime;
  1370.             if(!flvplayback_internal::_skinFadingIn)
  1371.             {
  1372.                _loc2_ = 1 - _loc2_;
  1373.             }
  1374.             if(_loc2_ < 0)
  1375.             {
  1376.                _loc2_ = 0;
  1377.             }
  1378.             else if(_loc2_ > 1)
  1379.             {
  1380.                _loc2_ = 1;
  1381.             }
  1382.             flvplayback_internal::skin_mc.alpha = _loc2_;
  1383.          }
  1384.       }
  1385.       
  1386.       flvplayback_internal function resetPlayPause() : void
  1387.       {
  1388.          if(flvplayback_internal::controls[PLAY_PAUSE_BUTTON] == undefined)
  1389.          {
  1390.             return;
  1391.          }
  1392.          var _loc1_:int = PAUSE_BUTTON;
  1393.          while(_loc1_ <= PLAY_BUTTON)
  1394.          {
  1395.             removeButtonListeners(flvplayback_internal::controls[_loc1_]);
  1396.             delete ctrlDataDict[flvplayback_internal::controls[_loc1_]];
  1397.             delete flvplayback_internal::controls[_loc1_];
  1398.             _loc1_++;
  1399.          }
  1400.          delete ctrlDataDict[flvplayback_internal::controls[PLAY_PAUSE_BUTTON]];
  1401.          delete flvplayback_internal::controls[PLAY_PAUSE_BUTTON];
  1402.       }
  1403.       
  1404.       public function setControl(param1:int, param2:Sprite) : void
  1405.       {
  1406.          var index:int = param1;
  1407.          var ctrl:Sprite = param2;
  1408.          if(ctrl == flvplayback_internal::controls[index])
  1409.          {
  1410.             return;
  1411.          }
  1412.          if(ctrl)
  1413.          {
  1414.             ctrl.tabEnabled = false;
  1415.          }
  1416.          switch(index)
  1417.          {
  1418.             case PAUSE_BUTTON:
  1419.             case PLAY_BUTTON:
  1420.                resetPlayPause();
  1421.                break;
  1422.             case PLAY_PAUSE_BUTTON:
  1423.                if(ctrl == null || ctrl.parent != flvplayback_internal::skin_mc)
  1424.                {
  1425.                   resetPlayPause();
  1426.                }
  1427.                if(ctrl != null)
  1428.                {
  1429.                   setControl(PAUSE_BUTTON,Sprite(ctrl.getChildByName("pause_mc")));
  1430.                   setControl(PLAY_BUTTON,Sprite(ctrl.getChildByName("play_mc")));
  1431.                }
  1432.                break;
  1433.             case FULL_SCREEN_BUTTON:
  1434.                if(ctrl != null)
  1435.                {
  1436.                   setControl(FULL_SCREEN_ON_BUTTON,Sprite(ctrl.getChildByName("on_mc")));
  1437.                   setControl(FULL_SCREEN_OFF_BUTTON,Sprite(ctrl.getChildByName("off_mc")));
  1438.                }
  1439.                break;
  1440.             case MUTE_BUTTON:
  1441.                if(ctrl != null)
  1442.                {
  1443.                   setControl(MUTE_ON_BUTTON,Sprite(ctrl.getChildByName("on_mc")));
  1444.                   setControl(MUTE_OFF_BUTTON,Sprite(ctrl.getChildByName("off_mc")));
  1445.                }
  1446.          }
  1447.          if(flvplayback_internal::controls[index] != null)
  1448.          {
  1449.             try
  1450.             {
  1451.                delete flvplayback_internal::controls[index]["uiMgr"];
  1452.             }
  1453.             catch(re:ReferenceError)
  1454.             {
  1455.             }
  1456.             if(index < NUM_BUTTONS)
  1457.             {
  1458.                removeButtonListeners(flvplayback_internal::controls[index]);
  1459.             }
  1460.             delete ctrlDataDict[flvplayback_internal::controls[index]];
  1461.             delete flvplayback_internal::controls[index];
  1462.          }
  1463.          if(ctrl == null)
  1464.          {
  1465.             return;
  1466.          }
  1467.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  1468.          if(ctrlData == null)
  1469.          {
  1470.             ctrlData = new ControlData(this,ctrl,null,index);
  1471.             ctrlDataDict[ctrl] = ctrlData;
  1472.          }
  1473.          else
  1474.          {
  1475.             ctrlData.index = index;
  1476.          }
  1477.          if(index >= NUM_BUTTONS)
  1478.          {
  1479.             flvplayback_internal::controls[index] = ctrl;
  1480.             switch(index)
  1481.             {
  1482.                case SEEK_BAR:
  1483.                   addBarControl(ctrl);
  1484.                   break;
  1485.                case VOLUME_BAR:
  1486.                   addBarControl(ctrl);
  1487.                   ctrlData.percentage = flvplayback_internal::_vc.volume * 100;
  1488.                   break;
  1489.                case BUFFERING_BAR:
  1490.                   if(ctrl.parent == flvplayback_internal::skin_mc)
  1491.                   {
  1492.                      finishAddBufferingBar();
  1493.                   }
  1494.                   else
  1495.                   {
  1496.                      ctrl.addEventListener(Event.ENTER_FRAME,flvplayback_internal::finishAddBufferingBar);
  1497.                   }
  1498.             }
  1499.             setEnabledAndVisibleForState(index,flvplayback_internal::_vc.state);
  1500.          }
  1501.          else
  1502.          {
  1503.             flvplayback_internal::controls[index] = ctrl;
  1504.             addButtonControl(ctrl);
  1505.          }
  1506.       }
  1507.       
  1508.       flvplayback_internal function bitmapCopyBorder() : void
  1509.       {
  1510.          var _loc2_:BitmapData = null;
  1511.          var _loc3_:Matrix = null;
  1512.          var _loc4_:Number = NaN;
  1513.          var _loc5_:Number = NaN;
  1514.          var _loc6_:Rectangle = null;
  1515.          var _loc7_:int = 0;
  1516.          var _loc8_:Number = NaN;
  1517.          var _loc9_:Number = NaN;
  1518.          var _loc10_:int = 0;
  1519.          var _loc11_:Bitmap = null;
  1520.          var _loc12_:Number = NaN;
  1521.          var _loc13_:Number = NaN;
  1522.          if(flvplayback_internal::border_mc == null || flvplayback_internal::borderCopy == null)
  1523.          {
  1524.             return;
  1525.          }
  1526.          var _loc1_:Rectangle = flvplayback_internal::border_mc.getBounds(flvplayback_internal::skin_mc);
  1527.          if(flvplayback_internal::borderPrevRect == null || !flvplayback_internal::borderPrevRect.equals(_loc1_))
  1528.          {
  1529.             flvplayback_internal::borderCopy.x = _loc1_.x;
  1530.             flvplayback_internal::borderCopy.y = _loc1_.y;
  1531.             _loc3_ = new Matrix(flvplayback_internal::border_mc.scaleX,0,0,flvplayback_internal::border_mc.scaleY,0,0);
  1532.             if(flvplayback_internal::borderScale9Rects == null)
  1533.             {
  1534.                _loc2_ = new BitmapData(_loc1_.width,_loc1_.height,true,0);
  1535.                _loc2_.draw(flvplayback_internal::border_mc,_loc3_,flvplayback_internal::borderColorTransform);
  1536.                Bitmap(flvplayback_internal::borderCopy.getChildAt(0)).bitmapData = _loc2_;
  1537.             }
  1538.             else
  1539.             {
  1540.                _loc4_ = 0;
  1541.                _loc5_ = 0;
  1542.                _loc6_ = new Rectangle(0,0,0,0);
  1543.                _loc7_ = 0;
  1544.                _loc8_ = 0;
  1545.                if(flvplayback_internal::borderScale9Rects[3] != null)
  1546.                {
  1547.                   _loc8_ += flvplayback_internal::borderScale9Rects[3].width;
  1548.                }
  1549.                if(flvplayback_internal::borderScale9Rects[5] != null)
  1550.                {
  1551.                   _loc8_ += flvplayback_internal::borderScale9Rects[5].width;
  1552.                }
  1553.                _loc9_ = 0;
  1554.                if(flvplayback_internal::borderScale9Rects[1] != null)
  1555.                {
  1556.                   _loc9_ += flvplayback_internal::borderScale9Rects[1].height;
  1557.                }
  1558.                if(flvplayback_internal::borderScale9Rects[7] != null)
  1559.                {
  1560.                   _loc9_ += flvplayback_internal::borderScale9Rects[7].height;
  1561.                }
  1562.                _loc10_ = 0;
  1563.                while(_loc10_ < flvplayback_internal::borderScale9Rects.length)
  1564.                {
  1565.                   if(_loc10_ % 3 == 0)
  1566.                   {
  1567.                      _loc4_ = 0;
  1568.                      _loc5_ += _loc6_.height;
  1569.                   }
  1570.                   if(flvplayback_internal::borderScale9Rects[_loc10_] != null)
  1571.                   {
  1572.                      _loc6_ = Rectangle(flvplayback_internal::borderScale9Rects[_loc10_]).clone();
  1573.                      _loc3_.a = 1;
  1574.                      if(_loc10_ == 1 || _loc10_ == 4 || _loc10_ == 7)
  1575.                      {
  1576.                         _loc12_ = (_loc1_.width - _loc8_) / _loc6_.width;
  1577.                         _loc6_.x *= _loc12_;
  1578.                         _loc6_.width *= _loc12_;
  1579.                         _loc6_.width = Math.round(_loc6_.width);
  1580.                         _loc3_.a *= _loc12_;
  1581.                      }
  1582.                      _loc3_.tx = -_loc6_.x;
  1583.                      _loc6_.x = 0;
  1584.                      _loc3_.d = 1;
  1585.                      if(_loc10_ >= 3 && _loc10_ <= 5)
  1586.                      {
  1587.                         _loc13_ = (_loc1_.height - _loc9_) / _loc6_.height;
  1588.                         _loc6_.y *= _loc13_;
  1589.                         _loc6_.height *= _loc13_;
  1590.                         _loc6_.height = Math.round(_loc6_.height);
  1591.                         _loc3_.d *= _loc13_;
  1592.                      }
  1593.                      _loc3_.ty = -_loc6_.y;
  1594.                      _loc6_.y = 0;
  1595.                      _loc2_ = new BitmapData(_loc6_.width,_loc6_.height,true,0);
  1596.                      _loc2_.draw(flvplayback_internal::border_mc,_loc3_,flvplayback_internal::borderColorTransform,null,_loc6_,false);
  1597.                      _loc11_ = Bitmap(flvplayback_internal::borderCopy.getChildAt(_loc7_));
  1598.                      _loc7_++;
  1599.                      _loc11_.bitmapData = _loc2_;
  1600.                      _loc11_.x = _loc4_;
  1601.                      _loc11_.y = _loc5_;
  1602.                      _loc4_ += _loc6_.width;
  1603.                   }
  1604.                   _loc10_++;
  1605.                }
  1606.             }
  1607.             borderPrevRect = _loc1_;
  1608.          }
  1609.       }
  1610.       
  1611.       flvplayback_internal function createSkin(param1:DisplayObject, param2:String) : DisplayObject
  1612.       {
  1613.          var stateSkinDesc:* = undefined;
  1614.          var theClass:Class = null;
  1615.          var definitionHolder:DisplayObject = param1;
  1616.          var skinName:String = param2;
  1617.          try
  1618.          {
  1619.             stateSkinDesc = definitionHolder[skinName];
  1620.             if(stateSkinDesc is String)
  1621.             {
  1622.                try
  1623.                {
  1624.                   theClass = Class(definitionHolder.loaderInfo.applicationDomain.getDefinition(stateSkinDesc));
  1625.                }
  1626.                catch(err1:Error)
  1627.                {
  1628.                   theClass = Class(getDefinitionByName(stateSkinDesc));
  1629.                }
  1630.                return DisplayObject(new theClass());
  1631.             }
  1632.             if(stateSkinDesc is Class)
  1633.             {
  1634.                return new stateSkinDesc();
  1635.             }
  1636.             if(stateSkinDesc is DisplayObject)
  1637.             {
  1638.                return stateSkinDesc;
  1639.             }
  1640.          }
  1641.          catch(err2:Error)
  1642.          {
  1643.             throw new VideoError(VideoError.MISSING_SKIN_STYLE,skinName);
  1644.          }
  1645.          return null;
  1646.       }
  1647.       
  1648.       flvplayback_internal function hookUpCustomComponents() : void
  1649.       {
  1650.          var i:int = 0;
  1651.          var dispObj:DisplayObject = null;
  1652.          var name:String = null;
  1653.          var index:int = 0;
  1654.          var ctrl:Sprite = null;
  1655.          focusRect = isFocusRectActive();
  1656.          var searchHash:Object = new Object();
  1657.          var doTheSearch:Boolean = false;
  1658.          i = 0;
  1659.          while(i < NUM_CONTROLS)
  1660.          {
  1661.             if(flvplayback_internal::controls[i] == null)
  1662.             {
  1663.                searchHash[flvplayback_internal::customComponentClassNames[i]] = i;
  1664.                doTheSearch = true;
  1665.             }
  1666.             i++;
  1667.          }
  1668.          if(!doTheSearch)
  1669.          {
  1670.             return;
  1671.          }
  1672.          i = 0;
  1673.          for(; i < flvplayback_internal::_vc.parent.numChildren; i++)
  1674.          {
  1675.             dispObj = flvplayback_internal::_vc.parent.getChildAt(i);
  1676.             name = getQualifiedClassName(dispObj);
  1677.             if(searchHash[name] != undefined)
  1678.             {
  1679.                if(typeof searchHash[name] == "number")
  1680.                {
  1681.                   index = int(searchHash[name]);
  1682.                   try
  1683.                   {
  1684.                      ctrl = Sprite(dispObj);
  1685.                      if((index >= NUM_BUTTONS || ctrl["placeholder_mc"] is DisplayObject) && ctrl["uiMgr"] == null)
  1686.                      {
  1687.                         setControl(index,ctrl);
  1688.                         searchHash[name] = ctrl;
  1689.                      }
  1690.                   }
  1691.                   catch(err:Error)
  1692.                   {
  1693.                      continue;
  1694.                   }
  1695.                }
  1696.             }
  1697.          }
  1698.       }
  1699.       
  1700.       flvplayback_internal function addButtonControl(param1:Sprite) : void
  1701.       {
  1702.          if(param1 == null)
  1703.          {
  1704.             return;
  1705.          }
  1706.          var _loc2_:ControlData = ctrlDataDict[param1];
  1707.          param1.buttonMode = true;
  1708.          param1.tabEnabled = true;
  1709.          param1.tabChildren = true;
  1710.          param1.focusRect = flvplayback_internal::focusRect;
  1711.          param1.accessibilityProperties = new AccessibilityProperties();
  1712.          param1.accessibilityProperties.forceSimple = true;
  1713.          param1.accessibilityProperties.silent = true;
  1714.          if(flvplayback_internal::accessibilityPropertyNames[_loc2_.index] != null)
  1715.          {
  1716.             param1.accessibilityProperties.name = flvplayback_internal::accessibilityPropertyNames[_loc2_.index];
  1717.             param1.accessibilityProperties.silent = false;
  1718.          }
  1719.          if(_loc2_.index == VOLUME_BAR_HIT || _loc2_.index == SEEK_BAR_HIT)
  1720.          {
  1721.             param1.buttonMode = false;
  1722.             param1.tabEnabled = false;
  1723.             param1.tabChildren = false;
  1724.             param1.focusRect = false;
  1725.             param1.accessibilityProperties.silent = true;
  1726.          }
  1727.          if(_loc2_.index == VOLUME_BAR_HANDLE || _loc2_.index == SEEK_BAR_HANDLE)
  1728.          {
  1729.             param1.graphics.moveTo(0,-18);
  1730.             param1.graphics.lineStyle(0,0,0);
  1731.             param1.graphics.lineTo(0,-18);
  1732.             param1.buttonMode = false;
  1733.             param1.focusRect = true;
  1734.             param1.accessibilityProperties.silent = false;
  1735.             configureBarAccessibility(_loc2_.index);
  1736.          }
  1737.          param1.mouseChildren = false;
  1738.          var _loc3_:int = flvplayback_internal::_vc.activeVideoPlayerIndex;
  1739.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  1740.          _loc2_.state = NORMAL_STATE;
  1741.          setEnabledAndVisibleForState(_loc2_.index,flvplayback_internal::_vc.state);
  1742.          param1.addEventListener(MouseEvent.ROLL_OVER,flvplayback_internal::handleButtonEvent);
  1743.          param1.addEventListener(MouseEvent.ROLL_OUT,flvplayback_internal::handleButtonEvent);
  1744.          param1.addEventListener(MouseEvent.MOUSE_DOWN,flvplayback_internal::handleButtonEvent);
  1745.          param1.addEventListener(MouseEvent.CLICK,flvplayback_internal::handleButtonEvent);
  1746.          param1.addEventListener(KeyboardEvent.KEY_DOWN,flvplayback_internal::handleKeyEvent);
  1747.          param1.addEventListener(KeyboardEvent.KEY_UP,flvplayback_internal::handleKeyEvent);
  1748.          param1.addEventListener(FocusEvent.FOCUS_IN,flvplayback_internal::handleFocusEvent);
  1749.          param1.addEventListener(FocusEvent.FOCUS_OUT,flvplayback_internal::handleFocusEvent);
  1750.          if(param1.parent == flvplayback_internal::skin_mc)
  1751.          {
  1752.             skinButtonControl(param1);
  1753.          }
  1754.          else
  1755.          {
  1756.             param1.addEventListener(Event.ENTER_FRAME,flvplayback_internal::skinButtonControl);
  1757.          }
  1758.          flvplayback_internal::_vc.activeVideoPlayerIndex = _loc3_;
  1759.       }
  1760.       
  1761.       flvplayback_internal function exitFullScreenTakeOver() : void
  1762.       {
  1763.          var fullScreenBG:Sprite = null;
  1764.          var cacheActiveIndex:int = 0;
  1765.          var i:int = 0;
  1766.          var vp:VideoPlayer = null;
  1767.          if(flvplayback_internal::cacheFLVPlaybackParent == null)
  1768.          {
  1769.             return;
  1770.          }
  1771.          flvplayback_internal::_vc.removeEventListener(Event.ADDED_TO_STAGE,flvplayback_internal::handleEvent);
  1772.          flvplayback_internal::_vc.stage.removeEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  1773.          try
  1774.          {
  1775.             if(flvplayback_internal::_fullScreenAccel)
  1776.             {
  1777.                flvplayback_internal::_vc.stage.fullScreenSourceRect = new Rectangle(0,0,-1,-1);
  1778.             }
  1779.             else
  1780.             {
  1781.                flvplayback_internal::_vc.stage.align = flvplayback_internal::cacheStageAlign;
  1782.                flvplayback_internal::_vc.stage.scaleMode = flvplayback_internal::cacheStageScaleMode;
  1783.             }
  1784.             fullScreenBG = Sprite(flvplayback_internal::_vc.getChildByName("fullScreenBG"));
  1785.             if(fullScreenBG != null)
  1786.             {
  1787.                flvplayback_internal::_vc.removeChild(fullScreenBG);
  1788.             }
  1789.             if(flvplayback_internal::hitTarget_mc != null)
  1790.             {
  1791.                flvplayback_internal::hitTarget_mc.graphics.clear();
  1792.                flvplayback_internal::hitTarget_mc.graphics.lineStyle(0,0,0);
  1793.                flvplayback_internal::hitTarget_mc.graphics.drawRect(0,0,flvplayback_internal::_vc.width,flvplayback_internal::_vc.height);
  1794.             }
  1795.             if(flvplayback_internal::_vc.parent != flvplayback_internal::cacheFLVPlaybackParent)
  1796.             {
  1797.                flvplayback_internal::cacheFLVPlaybackParent.addChildAt(flvplayback_internal::_vc,flvplayback_internal::cacheFLVPlaybackIndex);
  1798.             }
  1799.             else
  1800.             {
  1801.                flvplayback_internal::cacheFLVPlaybackParent.setChildIndex(flvplayback_internal::_vc,flvplayback_internal::cacheFLVPlaybackIndex);
  1802.             }
  1803.             cacheActiveIndex = flvplayback_internal::_vc.activeVideoPlayerIndex;
  1804.             i = 0;
  1805.             while(i < flvplayback_internal::_vc.videoPlayers.length)
  1806.             {
  1807.                vp = flvplayback_internal::_vc.videoPlayers[i] as VideoPlayer;
  1808.                if(vp != null)
  1809.                {
  1810.                   flvplayback_internal::_vc.activeVideoPlayerIndex = i;
  1811.                   if(flvplayback_internal::cacheFLVPlaybackScaleMode[i] != undefined)
  1812.                   {
  1813.                      flvplayback_internal::_vc.scaleMode = flvplayback_internal::cacheFLVPlaybackScaleMode[i];
  1814.                   }
  1815.                   if(flvplayback_internal::cacheFLVPlaybackAlign[i])
  1816.                   {
  1817.                      flvplayback_internal::_vc.align = flvplayback_internal::cacheFLVPlaybackAlign[i];
  1818.                   }
  1819.                }
  1820.                i++;
  1821.             }
  1822.             flvplayback_internal::_vc.activeVideoPlayerIndex = cacheActiveIndex;
  1823.             flvplayback_internal::_vc.registrationX = flvplayback_internal::cacheFLVPlaybackLocation.x;
  1824.             flvplayback_internal::_vc.registrationY = flvplayback_internal::cacheFLVPlaybackLocation.y;
  1825.             flvplayback_internal::_vc.setSize(flvplayback_internal::cacheFLVPlaybackLocation.width,flvplayback_internal::cacheFLVPlaybackLocation.height);
  1826.          }
  1827.          catch(err:Error)
  1828.          {
  1829.          }
  1830.          flvplayback_internal::_vc.addEventListener(Event.ADDED_TO_STAGE,flvplayback_internal::handleEvent);
  1831.          flvplayback_internal::_vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  1832.          _fullScreen = false;
  1833.          _fullScreenAccel = false;
  1834.          cacheStageAlign = null;
  1835.          cacheStageScaleMode = null;
  1836.          cacheFLVPlaybackParent = null;
  1837.          cacheFLVPlaybackIndex = 0;
  1838.          cacheFLVPlaybackLocation = null;
  1839.          cacheFLVPlaybackScaleMode = null;
  1840.          cacheFLVPlaybackAlign = null;
  1841.          if(flvplayback_internal::_skinAutoHide != flvplayback_internal::cacheSkinAutoHide)
  1842.          {
  1843.             _skinAutoHide = flvplayback_internal::cacheSkinAutoHide;
  1844.             setupSkinAutoHide(false);
  1845.          }
  1846.       }
  1847.       
  1848.       flvplayback_internal function positionMaskedFill(param1:DisplayObject, param2:Number) : void
  1849.       {
  1850.          var ctrlData:ControlData = null;
  1851.          var slideReveal:Boolean = false;
  1852.          var maskSprite:Sprite = null;
  1853.          var barData:ControlData = null;
  1854.          var ctrl:DisplayObject = param1;
  1855.          var percent:Number = param2;
  1856.          if(ctrl == null)
  1857.          {
  1858.             return;
  1859.          }
  1860.          ctrlData = ctrlDataDict[ctrl];
  1861.          var fill:DisplayObject = ctrlData.fill_mc;
  1862.          if(fill == null)
  1863.          {
  1864.             return;
  1865.          }
  1866.          var mask:DisplayObject = ctrlData.mask_mc;
  1867.          if(ctrlData.mask_mc == null)
  1868.          {
  1869.             try
  1870.             {
  1871.                ctrlData.mask_mc = mask = ctrl["mask_mc"];
  1872.             }
  1873.             catch(re:ReferenceError)
  1874.             {
  1875.                ctrlData.mask_mc = null;
  1876.             }
  1877.             if(ctrlData.mask_mc == null)
  1878.             {
  1879.                maskSprite = new Sprite();
  1880.                ctrlData.mask_mc = mask = maskSprite;
  1881.                maskSprite.graphics.beginFill(16777215);
  1882.                maskSprite.graphics.drawRect(0,0,1,1);
  1883.                maskSprite.graphics.endFill();
  1884.                barData = ctrlDataDict[fill];
  1885.                maskSprite.x = barData.origX;
  1886.                maskSprite.y = barData.origY;
  1887.                maskSprite.width = barData.origWidth;
  1888.                maskSprite.height = barData.origHeight;
  1889.                maskSprite.visible = false;
  1890.                fill.parent.addChild(maskSprite);
  1891.                fill.mask = maskSprite;
  1892.             }
  1893.             if(ctrlData.mask_mc != null)
  1894.             {
  1895.                calcBarMargins(ctrl,"mask",true);
  1896.             }
  1897.          }
  1898.          var fillData:ControlData = ctrlDataDict[fill];
  1899.          var maskData:ControlData = ctrlDataDict[mask];
  1900.          try
  1901.          {
  1902.             slideReveal = fill["slideReveal"];
  1903.          }
  1904.          catch(re:ReferenceError)
  1905.          {
  1906.             slideReveal = false;
  1907.          }
  1908.          if(fill.parent == ctrl)
  1909.          {
  1910.             if(slideReveal)
  1911.             {
  1912.                fill.x = maskData.origX - fillData.origWidth + fillData.origWidth * percent / 100;
  1913.             }
  1914.             else
  1915.             {
  1916.                mask.width = fillData.origWidth * percent / 100;
  1917.             }
  1918.          }
  1919.          else if(fill.parent == ctrl.parent)
  1920.          {
  1921.             if(slideReveal)
  1922.             {
  1923.                mask.x = ctrl.x + maskData.leftMargin;
  1924.                mask.y = ctrl.y + maskData.topMargin;
  1925.                mask.width = ctrl.width - maskData.rightMargin - maskData.leftMargin;
  1926.                mask.height = ctrl.height - maskData.topMargin - maskData.bottomMargin;
  1927.                fill.x = mask.x - fillData.origWidth + maskData.origWidth * percent / 100;
  1928.                fill.y = ctrl.y + fillData.topMargin;
  1929.             }
  1930.             else
  1931.             {
  1932.                fill.x = ctrl.x + fillData.leftMargin;
  1933.                fill.y = ctrl.y + fillData.topMargin;
  1934.                mask.x = fill.x;
  1935.                mask.y = fill.y;
  1936.                mask.width = (ctrl.width - fillData.rightMargin - fillData.leftMargin) * percent / 100;
  1937.                mask.height = ctrl.height - fillData.topMargin - fillData.bottomMargin;
  1938.             }
  1939.          }
  1940.       }
  1941.       
  1942.       flvplayback_internal function calcPercentageFromHandle(param1:Sprite) : void
  1943.       {
  1944.          if(param1 == null)
  1945.          {
  1946.             return;
  1947.          }
  1948.          var _loc2_:ControlData = ctrlDataDict[param1];
  1949.          if(param1["calcPercentageFromHandle"] is Function && param1["calcPercentageFromHandle"]())
  1950.          {
  1951.             if(_loc2_.percentage < 0)
  1952.             {
  1953.                _loc2_.percentage = 0;
  1954.             }
  1955.             if(_loc2_.percentage > 100)
  1956.             {
  1957.                _loc2_.percentage = 100;
  1958.             }
  1959.             return;
  1960.          }
  1961.          var _loc3_:Sprite = _loc2_.handle_mc;
  1962.          if(_loc3_ == null)
  1963.          {
  1964.             return;
  1965.          }
  1966.          var _loc4_:ControlData = ctrlDataDict[_loc3_];
  1967.          var _loc5_:Number;
  1968.          var _loc6_:Number = (_loc5_ = !!isNaN(_loc2_.origWidth) ? Number(param1.width) : Number(_loc2_.origWidth)) - _loc4_.rightMargin - _loc4_.leftMargin;
  1969.          var _loc7_:Number = _loc3_.x - (param1.x + _loc4_.leftMargin);
  1970.          _loc2_.percentage = _loc7_ / _loc6_ * 100;
  1971.          if(_loc2_.percentage < 0)
  1972.          {
  1973.             _loc2_.percentage = 0;
  1974.          }
  1975.          if(_loc2_.percentage > 100)
  1976.          {
  1977.             _loc2_.percentage = 100;
  1978.          }
  1979.          if(_loc2_.fullness_mc != null)
  1980.          {
  1981.             positionBar(param1,"fullness",_loc2_.percentage);
  1982.          }
  1983.       }
  1984.       
  1985.       flvplayback_internal function setTwoButtonHolderSkin(param1:int, param2:int, param3:String, param4:int, param5:String, param6:DisplayObject) : Sprite
  1986.       {
  1987.          var _loc7_:Sprite = null;
  1988.          var _loc8_:Sprite = null;
  1989.          var _loc9_:ControlData = null;
  1990.          _loc8_ = new Sprite();
  1991.          _loc9_ = new ControlData(this,_loc8_,null,param1);
  1992.          ctrlDataDict[_loc8_] = _loc9_;
  1993.          flvplayback_internal::skin_mc.addChild(_loc8_);
  1994.          (_loc7_ = setupButtonSkin(param2,param6)).name = param3;
  1995.          _loc7_.visible = true;
  1996.          _loc8_.addChild(_loc7_);
  1997.          (_loc7_ = setupButtonSkin(param4,param6)).name = param5;
  1998.          _loc7_.visible = false;
  1999.          _loc8_.addChild(_loc7_);
  2000.          return _loc8_;
  2001.       }
  2002.       
  2003.       flvplayback_internal function handleRelease(param1:int) : void
  2004.       {
  2005.          var _loc2_:int = flvplayback_internal::_vc.activeVideoPlayerIndex;
  2006.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  2007.          if(param1 == SEEK_BAR)
  2008.          {
  2009.             seekBarListener(null);
  2010.          }
  2011.          else if(param1 == VOLUME_BAR)
  2012.          {
  2013.             volumeBarListener(null);
  2014.          }
  2015.          stopHandleDrag(flvplayback_internal::controls[param1]);
  2016.          flvplayback_internal::_vc.activeVideoPlayerIndex = _loc2_;
  2017.          if(param1 == SEEK_BAR)
  2018.          {
  2019.             flvplayback_internal::_vc._scrubFinish();
  2020.          }
  2021.       }
  2022.       
  2023.       public function set seekBarInterval(param1:Number) : void
  2024.       {
  2025.          if(flvplayback_internal::_seekBarTimer.delay == param1)
  2026.          {
  2027.             return;
  2028.          }
  2029.          flvplayback_internal::_seekBarTimer.delay = param1;
  2030.       }
  2031.       
  2032.       flvplayback_internal function skinAutoHideHitTest(param1:TimerEvent, param2:Boolean = true) : void
  2033.       {
  2034.          var visibleVP:VideoPlayer = null;
  2035.          var hit:Boolean = false;
  2036.          var e:TimerEvent = param1;
  2037.          var doFade:Boolean = param2;
  2038.          try
  2039.          {
  2040.             if(!flvplayback_internal::__visible)
  2041.             {
  2042.                flvplayback_internal::skin_mc.visible = false;
  2043.                if(flvplayback_internal::hitTarget_mc)
  2044.                {
  2045.                   flvplayback_internal::hitTarget_mc.accessibilityProperties.name = flvplayback_internal::accessibilityPropertyNames[SHOW_CONTROLS_BUTTON];
  2046.                }
  2047.             }
  2048.             else if(flvplayback_internal::_vc.stage != null)
  2049.             {
  2050.                visibleVP = flvplayback_internal::_vc.getVideoPlayer(flvplayback_internal::_vc.visibleVideoPlayerIndex);
  2051.                hit = visibleVP.hitTestPoint(flvplayback_internal::_vc.stage.mouseX,flvplayback_internal::_vc.stage.mouseY,true);
  2052.                if(flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenTakeOver && e != null)
  2053.                {
  2054.                   if(flvplayback_internal::_vc.stage.mouseX == flvplayback_internal::_skinAutoHideMouseX && flvplayback_internal::_vc.stage.mouseY == flvplayback_internal::_skinAutoHideMouseY)
  2055.                   {
  2056.                      if(getTimer() - flvplayback_internal::_skinAutoHideLastMotionTime > flvplayback_internal::_skinAutoHideMotionTimeout)
  2057.                      {
  2058.                         hit = false;
  2059.                      }
  2060.                   }
  2061.                   else
  2062.                   {
  2063.                      _skinAutoHideLastMotionTime = getTimer();
  2064.                      _skinAutoHideMouseX = flvplayback_internal::_vc.stage.mouseX;
  2065.                      _skinAutoHideMouseY = flvplayback_internal::_vc.stage.mouseY;
  2066.                   }
  2067.                }
  2068.                if(!hit && flvplayback_internal::border_mc != null)
  2069.                {
  2070.                   hit = flvplayback_internal::border_mc.hitTestPoint(flvplayback_internal::_vc.stage.mouseX,flvplayback_internal::_vc.stage.mouseY,true);
  2071.                   if(hit && flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenTakeOver)
  2072.                   {
  2073.                      _skinAutoHideLastMotionTime = getTimer();
  2074.                   }
  2075.                }
  2076.                if(!doFade || flvplayback_internal::_skinFadingMaxTime <= 0)
  2077.                {
  2078.                   flvplayback_internal::_skinFadingTimer.stop();
  2079.                   flvplayback_internal::skin_mc.visible = hit;
  2080.                   flvplayback_internal::skin_mc.alpha = 1;
  2081.                }
  2082.                else if(!(hit && flvplayback_internal::skin_mc.visible && (!flvplayback_internal::_skinFadingTimer.running || flvplayback_internal::_skinFadingIn) || !hit && (!flvplayback_internal::skin_mc.visible || flvplayback_internal::_skinFadingTimer.running && !flvplayback_internal::_skinFadingIn)))
  2083.                {
  2084.                   flvplayback_internal::_skinFadingTimer.stop();
  2085.                   _skinFadingIn = hit;
  2086.                   if(flvplayback_internal::_skinFadingIn && flvplayback_internal::skin_mc.alpha == 1)
  2087.                   {
  2088.                      flvplayback_internal::skin_mc.alpha = 0;
  2089.                   }
  2090.                   _skinFadeStartTime = getTimer();
  2091.                   flvplayback_internal::_skinFadingTimer.start();
  2092.                   flvplayback_internal::skin_mc.visible = true;
  2093.                }
  2094.                if(flvplayback_internal::hitTarget_mc)
  2095.                {
  2096.                   flvplayback_internal::hitTarget_mc.accessibilityProperties.name = !!hit ? flvplayback_internal::accessibilityPropertyNames[HIDE_CONTROLS_BUTTON] : flvplayback_internal::accessibilityPropertyNames[SHOW_CONTROLS_BUTTON];
  2097.                }
  2098.             }
  2099.          }
  2100.          catch(se:SecurityError)
  2101.          {
  2102.             flvplayback_internal::_skinAutoHideTimer.stop();
  2103.             flvplayback_internal::_skinFadingTimer.stop();
  2104.             flvplayback_internal::skin_mc.visible = flvplayback_internal::__visible;
  2105.             flvplayback_internal::skin_mc.alpha = 1;
  2106.             if(flvplayback_internal::hitTarget_mc)
  2107.             {
  2108.                flvplayback_internal::hitTarget_mc.accessibilityProperties.name = flvplayback_internal::accessibilityPropertyNames[HIDE_CONTROLS_BUTTON];
  2109.             }
  2110.          }
  2111.          if(flvplayback_internal::hitTarget_mc && Capabilities.hasAccessibility)
  2112.          {
  2113.             Accessibility.updateProperties();
  2114.          }
  2115.       }
  2116.       
  2117.       flvplayback_internal function layoutControl(param1:DisplayObject) : void
  2118.       {
  2119.          var _loc4_:Sprite = null;
  2120.          var _loc5_:Rectangle = null;
  2121.          if(param1 == null)
  2122.          {
  2123.             return;
  2124.          }
  2125.          var _loc2_:ControlData = ctrlDataDict[param1];
  2126.          if(_loc2_ == null)
  2127.          {
  2128.             return;
  2129.          }
  2130.          if(_loc2_.avatar == null)
  2131.          {
  2132.             return;
  2133.          }
  2134.          var _loc3_:Rectangle = calcLayoutControl(param1);
  2135.          param1.x = _loc3_.x;
  2136.          param1.y = _loc3_.y;
  2137.          param1.width = _loc3_.width;
  2138.          param1.height = _loc3_.height;
  2139.          switch(_loc2_.index)
  2140.          {
  2141.             case SEEK_BAR:
  2142.             case VOLUME_BAR:
  2143.                if(_loc2_.hit_mc != null && _loc2_.hit_mc.parent == flvplayback_internal::skin_mc)
  2144.                {
  2145.                   _loc4_ = _loc2_.hit_mc;
  2146.                   _loc5_ = calcLayoutControl(_loc4_);
  2147.                   _loc4_.x = _loc5_.x;
  2148.                   _loc4_.y = _loc5_.y;
  2149.                   _loc4_.width = _loc5_.width;
  2150.                   _loc4_.height = _loc5_.height;
  2151.                }
  2152.                if(_loc2_.progress_mc != null)
  2153.                {
  2154.                   if(isNaN(flvplayback_internal::_progressPercent))
  2155.                   {
  2156.                      _progressPercent = !!flvplayback_internal::_vc.isRTMP ? Number(100) : Number(0);
  2157.                   }
  2158.                   positionBar(Sprite(param1),"progress",flvplayback_internal::_progressPercent);
  2159.                }
  2160.                positionHandle(Sprite(param1));
  2161.                break;
  2162.             case BUFFERING_BAR:
  2163.                positionMaskedFill(param1,100);
  2164.          }
  2165.       }
  2166.       
  2167.       public function set fullScreenSkinDelay(param1:int) : void
  2168.       {
  2169.          _skinAutoHideMotionTimeout = param1;
  2170.       }
  2171.       
  2172.       flvplayback_internal function captureMouseEvent(param1:MouseEvent) : void
  2173.       {
  2174.          param1.stopPropagation();
  2175.       }
  2176.       
  2177.       flvplayback_internal function positionHandle(param1:Sprite) : void
  2178.       {
  2179.          if(param1 == null)
  2180.          {
  2181.             return;
  2182.          }
  2183.          if(param1["positionHandle"] is Function && param1["positionHandle"]())
  2184.          {
  2185.             return;
  2186.          }
  2187.          var _loc2_:ControlData = ctrlDataDict[param1];
  2188.          var _loc3_:Sprite = _loc2_.handle_mc;
  2189.          if(_loc3_ == null)
  2190.          {
  2191.             return;
  2192.          }
  2193.          var _loc4_:ControlData = ctrlDataDict[_loc3_];
  2194.          var _loc5_:Number;
  2195.          var _loc6_:Number = (_loc5_ = !!isNaN(_loc2_.origWidth) ? Number(param1.width) : Number(_loc2_.origWidth)) - _loc4_.rightMargin - _loc4_.leftMargin;
  2196.          _loc3_.x = param1.x + _loc4_.leftMargin + _loc6_ * _loc2_.percentage / 100;
  2197.          _loc3_.y = param1.y + _loc4_.origY;
  2198.          if(_loc2_.fullness_mc != null)
  2199.          {
  2200.             positionBar(param1,"fullness",_loc2_.percentage);
  2201.          }
  2202.       }
  2203.       
  2204.       flvplayback_internal function handleMouseUp(param1:MouseEvent) : void
  2205.       {
  2206.          var _loc3_:ControlData = null;
  2207.          var _loc2_:Sprite = flvplayback_internal::controls[flvplayback_internal::mouseCaptureCtrl];
  2208.          if(_loc2_ != null)
  2209.          {
  2210.             _loc3_ = ctrlDataDict[_loc2_];
  2211.             _loc3_.state = !!_loc2_.hitTestPoint(param1.stageX,param1.stageY,true) ? uint(OVER_STATE) : uint(NORMAL_STATE);
  2212.             skinButtonControl(_loc2_);
  2213.             switch(flvplayback_internal::mouseCaptureCtrl)
  2214.             {
  2215.                case SEEK_BAR_HANDLE:
  2216.                case SEEK_BAR_HIT:
  2217.                   handleRelease(SEEK_BAR);
  2218.                   break;
  2219.                case VOLUME_BAR_HANDLE:
  2220.                case VOLUME_BAR_HIT:
  2221.                   handleRelease(VOLUME_BAR);
  2222.                   break;
  2223.                case FULL_SCREEN_OFF_BUTTON:
  2224.                case FULL_SCREEN_ON_BUTTON:
  2225.                   dispatchMessage(_loc3_.index);
  2226.             }
  2227.          }
  2228.          param1.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN,flvplayback_internal::captureMouseEvent,true);
  2229.          param1.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT,flvplayback_internal::captureMouseEvent,true);
  2230.          param1.currentTarget.removeEventListener(MouseEvent.MOUSE_OVER,flvplayback_internal::captureMouseEvent,true);
  2231.          param1.currentTarget.removeEventListener(MouseEvent.MOUSE_UP,flvplayback_internal::handleMouseUp);
  2232.          param1.currentTarget.removeEventListener(MouseEvent.ROLL_OUT,flvplayback_internal::captureMouseEvent,true);
  2233.          param1.currentTarget.removeEventListener(MouseEvent.ROLL_OVER,flvplayback_internal::captureMouseEvent,true);
  2234.       }
  2235.       
  2236.       public function set visible(param1:Boolean) : void
  2237.       {
  2238.          if(flvplayback_internal::__visible == param1)
  2239.          {
  2240.             return;
  2241.          }
  2242.          __visible = param1;
  2243.          if(!flvplayback_internal::__visible)
  2244.          {
  2245.             flvplayback_internal::skin_mc.visible = false;
  2246.          }
  2247.          else
  2248.          {
  2249.             setupSkinAutoHide(false);
  2250.          }
  2251.       }
  2252.       
  2253.       public function get bufferingDelayInterval() : Number
  2254.       {
  2255.          return flvplayback_internal::_bufferingDelayTimer.delay;
  2256.       }
  2257.       
  2258.       flvplayback_internal function handleFocusEvent(param1:FocusEvent) : void
  2259.       {
  2260.          var _loc2_:ControlData = ctrlDataDict[param1.currentTarget];
  2261.          if(_loc2_ == null)
  2262.          {
  2263.             return;
  2264.          }
  2265.          switch(param1.type)
  2266.          {
  2267.             case FocusEvent.FOCUS_IN:
  2268.                switch(param1.target)
  2269.                {
  2270.                   case flvplayback_internal::controls[SEEK_BAR_HANDLE]:
  2271.                   case flvplayback_internal::controls[VOLUME_BAR_HANDLE]:
  2272.                      param1.target.focusRect = false;
  2273.                }
  2274.                _loc2_.state = OVER_STATE;
  2275.                break;
  2276.             case FocusEvent.FOCUS_OUT:
  2277.                switch(param1.target)
  2278.                {
  2279.                   case flvplayback_internal::controls[SEEK_BAR_HANDLE]:
  2280.                   case flvplayback_internal::controls[VOLUME_BAR_HANDLE]:
  2281.                      param1.target.focusRect = true;
  2282.                      break;
  2283.                   case flvplayback_internal::controls[STOP_BUTTON]:
  2284.                      if(!_loc2_.enabled)
  2285.                      {
  2286.                         param1.target.tabEnabled = false;
  2287.                      }
  2288.                }
  2289.                _loc2_.state = NORMAL_STATE;
  2290.          }
  2291.          skinButtonControl(param1.currentTarget);
  2292.       }
  2293.       
  2294.       public function set fullScreenBackgroundColor(param1:uint) : void
  2295.       {
  2296.          if(flvplayback_internal::_fullScreenBgColor != param1)
  2297.          {
  2298.             _fullScreenBgColor = param1;
  2299.             if(!flvplayback_internal::_vc)
  2300.             {
  2301.             }
  2302.          }
  2303.       }
  2304.       
  2305.       public function get fullScreenTakeOver() : Boolean
  2306.       {
  2307.          return flvplayback_internal::_fullScreenTakeOver;
  2308.       }
  2309.       
  2310.       public function set skin(param1:String) : void
  2311.       {
  2312.          var _loc2_:String = null;
  2313.          if(param1 == null)
  2314.          {
  2315.             removeSkin();
  2316.             _skin = null;
  2317.             _skinReady = true;
  2318.          }
  2319.          else
  2320.          {
  2321.             _loc2_ = String(param1);
  2322.             if(param1 == flvplayback_internal::_skin)
  2323.             {
  2324.                return;
  2325.             }
  2326.             removeSkin();
  2327.             _skin = String(param1);
  2328.             _skinReady = flvplayback_internal::_skin == "";
  2329.             if(!flvplayback_internal::_skinReady)
  2330.             {
  2331.                downloadSkin();
  2332.             }
  2333.          }
  2334.       }
  2335.       
  2336.       public function set volumeBarInterval(param1:Number) : void
  2337.       {
  2338.          if(flvplayback_internal::_volumeBarTimer.delay == param1)
  2339.          {
  2340.             return;
  2341.          }
  2342.          flvplayback_internal::_volumeBarTimer.delay = param1;
  2343.       }
  2344.       
  2345.       flvplayback_internal function setSkin(param1:int, param2:DisplayObject) : void
  2346.       {
  2347.          var _loc3_:Sprite = null;
  2348.          var _loc4_:ControlData = null;
  2349.          var _loc5_:String = null;
  2350.          if(param1 >= NUM_CONTROLS)
  2351.          {
  2352.             return;
  2353.          }
  2354.          if(param1 < NUM_BUTTONS)
  2355.          {
  2356.             _loc3_ = setupButtonSkin(param1,param2);
  2357.             flvplayback_internal::skin_mc.addChild(_loc3_);
  2358.             _loc4_ = ctrlDataDict[_loc3_];
  2359.          }
  2360.          else
  2361.          {
  2362.             switch(param1)
  2363.             {
  2364.                case PLAY_PAUSE_BUTTON:
  2365.                   _loc3_ = setTwoButtonHolderSkin(param1,PLAY_BUTTON,"play_mc",PAUSE_BUTTON,"pause_mc",param2);
  2366.                   _loc4_ = ctrlDataDict[_loc3_];
  2367.                   break;
  2368.                case FULL_SCREEN_BUTTON:
  2369.                   _loc3_ = setTwoButtonHolderSkin(param1,FULL_SCREEN_ON_BUTTON,"on_mc",FULL_SCREEN_OFF_BUTTON,"off_mc",param2);
  2370.                   _loc4_ = ctrlDataDict[_loc3_];
  2371.                   break;
  2372.                case MUTE_BUTTON:
  2373.                   _loc3_ = setTwoButtonHolderSkin(param1,MUTE_ON_BUTTON,"on_mc",MUTE_OFF_BUTTON,"off_mc",param2);
  2374.                   _loc4_ = ctrlDataDict[_loc3_];
  2375.                   break;
  2376.                case SEEK_BAR:
  2377.                case VOLUME_BAR:
  2378.                   _loc5_ = flvplayback_internal::skinClassPrefixes[param1];
  2379.                   _loc3_ = Sprite(createSkin(flvplayback_internal::skinTemplate,_loc5_));
  2380.                   if(_loc3_ != null)
  2381.                   {
  2382.                      flvplayback_internal::skin_mc.addChild(_loc3_);
  2383.                      _loc4_ = new ControlData(this,_loc3_,null,param1);
  2384.                      ctrlDataDict[_loc3_] = _loc4_;
  2385.                      _loc4_.progress_mc = setupBarSkinPart(_loc3_,param2,flvplayback_internal::skinTemplate,_loc5_ + "Progress","progress_mc");
  2386.                      _loc4_.fullness_mc = setupBarSkinPart(_loc3_,param2,flvplayback_internal::skinTemplate,_loc5_ + "Fullness","fullness_mc");
  2387.                      _loc4_.hit_mc = Sprite(setupBarSkinPart(_loc3_,param2,flvplayback_internal::skinTemplate,_loc5_ + "Hit","hit_mc"));
  2388.                      _loc4_.handle_mc = Sprite(setupBarSkinPart(_loc3_,param2,flvplayback_internal::skinTemplate,_loc5_ + "Handle","handle_mc",true));
  2389.                      _loc3_.width = param2.width;
  2390.                      _loc3_.height = param2.height;
  2391.                      _loc3_.accessibilityProperties = new AccessibilityProperties();
  2392.                      _loc3_.accessibilityProperties.silent = true;
  2393.                   }
  2394.                   break;
  2395.                case BUFFERING_BAR:
  2396.                   _loc5_ = flvplayback_internal::skinClassPrefixes[param1];
  2397.                   _loc3_ = Sprite(createSkin(flvplayback_internal::skinTemplate,_loc5_));
  2398.                   if(_loc3_ != null)
  2399.                   {
  2400.                      flvplayback_internal::skin_mc.addChild(_loc3_);
  2401.                      _loc4_ = new ControlData(this,_loc3_,null,param1);
  2402.                      ctrlDataDict[_loc3_] = _loc4_;
  2403.                      _loc4_.fill_mc = setupBarSkinPart(_loc3_,param2,flvplayback_internal::skinTemplate,_loc5_ + "Fill","fill_mc");
  2404.                      _loc3_.width = param2.width;
  2405.                      _loc3_.height = param2.height;
  2406.                      _loc4_.fill_mc.accessibilityProperties = new AccessibilityProperties();
  2407.                      _loc4_.fill_mc.accessibilityProperties.silent = true;
  2408.                      _loc3_.accessibilityProperties = new AccessibilityProperties();
  2409.                      _loc3_.accessibilityProperties.silent = true;
  2410.                   }
  2411.             }
  2412.          }
  2413.          _loc4_.avatar = param2;
  2414.          ctrlDataDict[_loc3_] = _loc4_;
  2415.          flvplayback_internal::delayedControls[param1] = _loc3_;
  2416.       }
  2417.       
  2418.       flvplayback_internal function configureBarAccessibility(param1:int) : void
  2419.       {
  2420.          switch(param1)
  2421.          {
  2422.             case SEEK_BAR_HANDLE:
  2423.                SeekBarAccImpl.createAccessibilityImplementation(flvplayback_internal::controls[SEEK_BAR_HANDLE]);
  2424.                break;
  2425.             case VOLUME_BAR_HANDLE:
  2426.                VolumeBarAccImpl.createAccessibilityImplementation(flvplayback_internal::controls[VOLUME_BAR_HANDLE]);
  2427.          }
  2428.       }
  2429.       
  2430.       public function set bufferingBarHidesAndDisablesOthers(param1:Boolean) : void
  2431.       {
  2432.          _bufferingBarHides = param1;
  2433.       }
  2434.       
  2435.       flvplayback_internal function handleSoundEvent(param1:SoundEvent) : void
  2436.       {
  2437.          var _loc3_:ControlData = null;
  2438.          if(flvplayback_internal::_isMuted && param1.soundTransform.volume > 0)
  2439.          {
  2440.             _isMuted = false;
  2441.             setEnabledAndVisibleForState(MUTE_OFF_BUTTON,VideoState.PLAYING);
  2442.             skinButtonControl(flvplayback_internal::controls[MUTE_OFF_BUTTON]);
  2443.             setEnabledAndVisibleForState(MUTE_ON_BUTTON,VideoState.PLAYING);
  2444.             skinButtonControl(flvplayback_internal::controls[MUTE_ON_BUTTON]);
  2445.          }
  2446.          var _loc2_:Sprite = flvplayback_internal::controls[VOLUME_BAR];
  2447.          if(_loc2_ != null)
  2448.          {
  2449.             _loc3_ = ctrlDataDict[_loc2_];
  2450.             _loc3_.percentage = (!!flvplayback_internal::_isMuted ? flvplayback_internal::cachedSoundLevel : param1.soundTransform.volume) * 100;
  2451.             if(_loc3_.percentage < 0)
  2452.             {
  2453.                _loc3_.percentage = 0;
  2454.             }
  2455.             else if(_loc3_.percentage > 100)
  2456.             {
  2457.                _loc3_.percentage = 100;
  2458.             }
  2459.             positionHandle(_loc2_);
  2460.          }
  2461.       }
  2462.       
  2463.       flvplayback_internal function stopHandleDrag(param1:Sprite) : void
  2464.       {
  2465.          var ctrl:Sprite = param1;
  2466.          if(ctrl == null)
  2467.          {
  2468.             return;
  2469.          }
  2470.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  2471.          try
  2472.          {
  2473.             if(ctrl["stopHandleDrag"] is Function && ctrl["stopHandleDrag"]())
  2474.             {
  2475.                ctrlData.isDragging = false;
  2476.                return;
  2477.             }
  2478.          }
  2479.          catch(re:ReferenceError)
  2480.          {
  2481.          }
  2482.          var handle:Sprite = ctrlData.handle_mc;
  2483.          if(handle == null)
  2484.          {
  2485.             return;
  2486.          }
  2487.          handle.stopDrag();
  2488.          ctrlData.isDragging = false;
  2489.          handle.stage.focus = handle;
  2490.       }
  2491.       
  2492.       public function set skinBackgroundAlpha(param1:Number) : void
  2493.       {
  2494.          if(flvplayback_internal::borderAlpha != param1)
  2495.          {
  2496.             borderAlpha = param1;
  2497.             flvplayback_internal::borderColorTransform.alphaOffset = 255 * param1;
  2498.             borderPrevRect = null;
  2499.             layoutSkin();
  2500.          }
  2501.       }
  2502.       
  2503.       public function getControl(param1:int) : Sprite
  2504.       {
  2505.          return flvplayback_internal::controls[param1];
  2506.       }
  2507.       
  2508.       public function set skinScaleMaximum(param1:Number) : void
  2509.       {
  2510.          _skinScaleMaximum = param1;
  2511.       }
  2512.       
  2513.       public function set volumeBarScrubTolerance(param1:Number) : void
  2514.       {
  2515.          _volumeBarScrubTolerance = param1;
  2516.       }
  2517.       
  2518.       flvplayback_internal function calcBarMargins(param1:DisplayObject, param2:String, param3:Boolean) : void
  2519.       {
  2520.          var ctrl:DisplayObject = param1;
  2521.          var type:String = param2;
  2522.          var symmetricMargins:Boolean = param3;
  2523.          if(ctrl == null)
  2524.          {
  2525.             return;
  2526.          }
  2527.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  2528.          var bar:DisplayObject = ctrlData[type + "_mc"];
  2529.          if(bar == null)
  2530.          {
  2531.             try
  2532.             {
  2533.                bar = ctrl[type + "_mc"];
  2534.             }
  2535.             catch(re:ReferenceError)
  2536.             {
  2537.                bar = null;
  2538.             }
  2539.             if(bar == null)
  2540.             {
  2541.                return;
  2542.             }
  2543.             ctrlData[type + "_mc"] = bar;
  2544.          }
  2545.          var barData:ControlData = ctrlDataDict[bar];
  2546.          if(barData == null)
  2547.          {
  2548.             barData = new ControlData(this,bar,ctrl,-1);
  2549.             ctrlDataDict[bar] = barData;
  2550.          }
  2551.          barData.leftMargin = getNumberPropSafe(ctrl,type + "LeftMargin");
  2552.          if(isNaN(barData.leftMargin) && bar.parent == ctrl.parent)
  2553.          {
  2554.             barData.leftMargin = bar.x - ctrl.x;
  2555.          }
  2556.          barData.rightMargin = getNumberPropSafe(ctrl,type + "RightMargin");
  2557.          if(isNaN(barData.rightMargin))
  2558.          {
  2559.             if(symmetricMargins)
  2560.             {
  2561.                barData.rightMargin = barData.leftMargin;
  2562.             }
  2563.             else if(bar.parent == ctrl.parent)
  2564.             {
  2565.                barData.rightMargin = ctrl.width - bar.width - bar.x + ctrl.x;
  2566.             }
  2567.          }
  2568.          barData.topMargin = getNumberPropSafe(ctrl,type + "TopMargin");
  2569.          if(isNaN(barData.topMargin) && bar.parent == ctrl.parent)
  2570.          {
  2571.             barData.topMargin = bar.y - ctrl.y;
  2572.          }
  2573.          barData.bottomMargin = getNumberPropSafe(ctrl,type + "BottomMargin");
  2574.          if(isNaN(barData.bottomMargin))
  2575.          {
  2576.             if(symmetricMargins)
  2577.             {
  2578.                barData.bottomMargin = barData.topMargin;
  2579.             }
  2580.             else if(bar.parent == ctrl.parent)
  2581.             {
  2582.                barData.bottomMargin = ctrl.height - bar.height - bar.y + ctrl.y;
  2583.             }
  2584.          }
  2585.          barData.origX = getNumberPropSafe(ctrl,type + "X");
  2586.          if(isNaN(barData.origX))
  2587.          {
  2588.             if(bar.parent == ctrl.parent)
  2589.             {
  2590.                barData.origX = bar.x - ctrl.x;
  2591.             }
  2592.             else if(bar.parent == ctrl)
  2593.             {
  2594.                barData.origX = bar.x;
  2595.             }
  2596.          }
  2597.          barData.origY = getNumberPropSafe(ctrl,type + "Y");
  2598.          if(isNaN(barData.origY))
  2599.          {
  2600.             if(bar.parent == ctrl.parent)
  2601.             {
  2602.                barData.origY = bar.y - ctrl.y;
  2603.             }
  2604.             else if(bar.parent == ctrl)
  2605.             {
  2606.                barData.origY = bar.y;
  2607.             }
  2608.          }
  2609.          barData.origWidth = bar.width;
  2610.          barData.origHeight = bar.height;
  2611.          barData.origScaleX = bar.scaleX;
  2612.          barData.origScaleY = bar.scaleY;
  2613.       }
  2614.       
  2615.       public function set skinBackgroundColor(param1:uint) : void
  2616.       {
  2617.          if(flvplayback_internal::borderColor != param1)
  2618.          {
  2619.             borderColor = param1;
  2620.             flvplayback_internal::borderColorTransform.redOffset = flvplayback_internal::borderColor >> 16 & 255;
  2621.             flvplayback_internal::borderColorTransform.greenOffset = flvplayback_internal::borderColor >> 8 & 255;
  2622.             flvplayback_internal::borderColorTransform.blueOffset = flvplayback_internal::borderColor & 255;
  2623.             borderPrevRect = null;
  2624.             layoutSkin();
  2625.          }
  2626.       }
  2627.       
  2628.       flvplayback_internal function handleLoad(param1:Event) : void
  2629.       {
  2630.          var i:int = 0;
  2631.          var dispObj:DisplayObject = null;
  2632.          var index:Number = NaN;
  2633.          var e:Event = param1;
  2634.          try
  2635.          {
  2636.             skin_mc = new Sprite();
  2637.             if(e != null)
  2638.             {
  2639.                skinTemplate = Sprite(flvplayback_internal::skinLoader.content);
  2640.             }
  2641.             layout_mc = flvplayback_internal::skinTemplate;
  2642.             customClips = new Array();
  2643.             delayedControls = new Array();
  2644.             i = 0;
  2645.             while(i < flvplayback_internal::layout_mc.numChildren)
  2646.             {
  2647.                dispObj = flvplayback_internal::layout_mc.getChildAt(i);
  2648.                index = flvplayback_internal::layoutNameToIndexMappings[dispObj.name];
  2649.                if(!isNaN(index))
  2650.                {
  2651.                   setSkin(int(index),dispObj);
  2652.                }
  2653.                else if(dispObj.name != "video_mc")
  2654.                {
  2655.                   setCustomClip(dispObj);
  2656.                }
  2657.                i++;
  2658.             }
  2659.             skinLoadDelayCount = 0;
  2660.             flvplayback_internal::_vc.addEventListener(Event.ENTER_FRAME,flvplayback_internal::finishLoad);
  2661.          }
  2662.          catch(err:Error)
  2663.          {
  2664.             flvplayback_internal::_vc.skinError(err.message);
  2665.             removeSkin();
  2666.          }
  2667.       }
  2668.       
  2669.       flvplayback_internal function finishAddBufferingBar(param1:Event = null) : void
  2670.       {
  2671.          if(param1 != null)
  2672.          {
  2673.             param1.currentTarget.removeEventListener(Event.ENTER_FRAME,flvplayback_internal::finishAddBufferingBar);
  2674.          }
  2675.          var _loc2_:Sprite = flvplayback_internal::controls[BUFFERING_BAR];
  2676.          calcBarMargins(_loc2_,"fill",true);
  2677.          fixUpBar(_loc2_,"fill",_loc2_,"fill_mc");
  2678.          positionMaskedFill(_loc2_,100);
  2679.       }
  2680.       
  2681.       flvplayback_internal function handleButtonEvent(param1:MouseEvent) : void
  2682.       {
  2683.          var topLevel:DisplayObject = null;
  2684.          var e:MouseEvent = param1;
  2685.          var ctrlData:ControlData = ctrlDataDict[e.currentTarget];
  2686.          switch(e.type)
  2687.          {
  2688.             case MouseEvent.ROLL_OVER:
  2689.                ctrlData.state = OVER_STATE;
  2690.                break;
  2691.             case MouseEvent.ROLL_OUT:
  2692.                ctrlData.state = NORMAL_STATE;
  2693.                break;
  2694.             case MouseEvent.MOUSE_DOWN:
  2695.                ctrlData.state = DOWN_STATE;
  2696.                mouseCaptureCtrl = ctrlData.index;
  2697.                switch(flvplayback_internal::mouseCaptureCtrl)
  2698.                {
  2699.                   case SEEK_BAR_HANDLE:
  2700.                   case SEEK_BAR_HIT:
  2701.                   case VOLUME_BAR_HANDLE:
  2702.                   case VOLUME_BAR_HIT:
  2703.                      dispatchMessage(ctrlData.index);
  2704.                }
  2705.                topLevel = flvplayback_internal::_vc.stage;
  2706.                try
  2707.                {
  2708.                   topLevel.addEventListener(MouseEvent.MOUSE_DOWN,flvplayback_internal::captureMouseEvent,true);
  2709.                }
  2710.                catch(se:SecurityError)
  2711.                {
  2712.                   topLevel = flvplayback_internal::_vc.root;
  2713.                   topLevel.addEventListener(MouseEvent.MOUSE_DOWN,flvplayback_internal::captureMouseEvent,true);
  2714.                }
  2715.                topLevel.addEventListener(MouseEvent.MOUSE_OUT,flvplayback_internal::captureMouseEvent,true);
  2716.                topLevel.addEventListener(MouseEvent.MOUSE_OVER,flvplayback_internal::captureMouseEvent,true);
  2717.                topLevel.addEventListener(MouseEvent.MOUSE_UP,flvplayback_internal::handleMouseUp);
  2718.                topLevel.addEventListener(MouseEvent.ROLL_OUT,flvplayback_internal::captureMouseEvent,true);
  2719.                topLevel.addEventListener(MouseEvent.ROLL_OVER,flvplayback_internal::captureMouseEvent,true);
  2720.                break;
  2721.             case MouseEvent.CLICK:
  2722.                switch(flvplayback_internal::mouseCaptureCtrl)
  2723.                {
  2724.                   case SEEK_BAR_HANDLE:
  2725.                   case SEEK_BAR_HIT:
  2726.                   case VOLUME_BAR_HANDLE:
  2727.                   case VOLUME_BAR_HIT:
  2728.                   case FULL_SCREEN_OFF_BUTTON:
  2729.                   case FULL_SCREEN_ON_BUTTON:
  2730.                      break;
  2731.                   default:
  2732.                      dispatchMessage(ctrlData.index);
  2733.                }
  2734.                return;
  2735.          }
  2736.          skinButtonControl(e.currentTarget);
  2737.       }
  2738.       
  2739.       flvplayback_internal function applySkinState(param1:ControlData, param2:DisplayObject) : void
  2740.       {
  2741.          if(param2 != param1.currentState_mc)
  2742.          {
  2743.             if(param1.currentState_mc != null)
  2744.             {
  2745.                param1.currentState_mc.visible = false;
  2746.             }
  2747.             param1.currentState_mc = param2;
  2748.             param1.currentState_mc.visible = true;
  2749.          }
  2750.       }
  2751.       
  2752.       flvplayback_internal function handleLoadErrorEvent(param1:ErrorEvent) : void
  2753.       {
  2754.          _skinReady = true;
  2755.          flvplayback_internal::_vc.skinError(param1.toString());
  2756.       }
  2757.       
  2758.       flvplayback_internal function addBarControl(param1:Sprite) : void
  2759.       {
  2760.          var _loc2_:ControlData = ctrlDataDict[param1];
  2761.          _loc2_.isDragging = false;
  2762.          _loc2_.percentage = 0;
  2763.          if(param1.parent == flvplayback_internal::skin_mc && flvplayback_internal::skin_mc != null)
  2764.          {
  2765.             finishAddBarControl(param1);
  2766.          }
  2767.          else
  2768.          {
  2769.             param1.addEventListener(Event.REMOVED_FROM_STAGE,flvplayback_internal::cleanupHandle);
  2770.             param1.addEventListener(Event.ENTER_FRAME,flvplayback_internal::finishAddBarControl);
  2771.          }
  2772.       }
  2773.       
  2774.       flvplayback_internal function handleEvent(param1:Event) : void
  2775.       {
  2776.          var e:Event = param1;
  2777.          switch(e.type)
  2778.          {
  2779.             case Event.ADDED_TO_STAGE:
  2780.                _fullScreen = false;
  2781.                if(flvplayback_internal::_vc.stage != null)
  2782.                {
  2783.                   try
  2784.                   {
  2785.                      _fullScreen = flvplayback_internal::_vc.stage.displayState == StageDisplayState.FULL_SCREEN;
  2786.                      flvplayback_internal::_vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  2787.                   }
  2788.                   catch(se:SecurityError)
  2789.                   {
  2790.                   }
  2791.                }
  2792.                if(!flvplayback_internal::_fullScreen)
  2793.                {
  2794.                   _fullScreenAccel = false;
  2795.                }
  2796.                setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON,VideoState.PLAYING);
  2797.                skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_OFF_BUTTON]);
  2798.                setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON,VideoState.PLAYING);
  2799.                skinButtonControl(flvplayback_internal::controls[FULL_SCREEN_ON_BUTTON]);
  2800.                if(flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenTakeOver)
  2801.                {
  2802.                   enterFullScreenTakeOver();
  2803.                }
  2804.                else if(!flvplayback_internal::_fullScreen)
  2805.                {
  2806.                   exitFullScreenTakeOver();
  2807.                }
  2808.                layoutSkin();
  2809.                setupSkinAutoHide(false);
  2810.                break;
  2811.             case Event.REMOVED_FROM_STAGE:
  2812.                flvplayback_internal::_vc.stage.removeEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  2813.          }
  2814.       }
  2815.       
  2816.       flvplayback_internal function skinButtonControl(param1:Object) : void
  2817.       {
  2818.          var ctrl:Sprite = null;
  2819.          var e:Event = null;
  2820.          var ctrlOrEvent:Object = param1;
  2821.          if(ctrlOrEvent == null)
  2822.          {
  2823.             return;
  2824.          }
  2825.          if(ctrlOrEvent is Event)
  2826.          {
  2827.             e = Event(ctrlOrEvent);
  2828.             ctrl = Sprite(e.currentTarget);
  2829.             ctrl.removeEventListener(Event.ENTER_FRAME,flvplayback_internal::skinButtonControl);
  2830.          }
  2831.          else
  2832.          {
  2833.             ctrl = Sprite(ctrlOrEvent);
  2834.          }
  2835.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  2836.          if(ctrlData == null)
  2837.          {
  2838.             return;
  2839.          }
  2840.          try
  2841.          {
  2842.             if(ctrl["placeholder_mc"] != undefined)
  2843.             {
  2844.                ctrl.removeChild(ctrl["placeholder_mc"]);
  2845.                ctrl["placeholder_mc"] = null;
  2846.             }
  2847.          }
  2848.          catch(re:ReferenceError)
  2849.          {
  2850.          }
  2851.          if(ctrlData.state_mc == null)
  2852.          {
  2853.             ctrlData.state_mc = new Array();
  2854.          }
  2855.          if(ctrlData.state_mc[NORMAL_STATE] == undefined)
  2856.          {
  2857.             ctrlData.state_mc[NORMAL_STATE] = setupButtonSkinState(ctrl,ctrl,flvplayback_internal::buttonSkinLinkageIDs[NORMAL_STATE],null);
  2858.          }
  2859.          if(ctrlData.enabled && flvplayback_internal::_controlsEnabled)
  2860.          {
  2861.             if(ctrlData.state_mc[ctrlData.state] == undefined)
  2862.             {
  2863.                ctrlData.state_mc[ctrlData.state] = setupButtonSkinState(ctrl,ctrl,flvplayback_internal::buttonSkinLinkageIDs[ctrlData.state],ctrlData.state_mc[NORMAL_STATE]);
  2864.             }
  2865.             if(ctrlData.state_mc[ctrlData.state] != ctrlData.currentState_mc)
  2866.             {
  2867.                if(ctrlData.currentState_mc != null)
  2868.                {
  2869.                   ctrlData.currentState_mc.visible = false;
  2870.                }
  2871.                ctrlData.currentState_mc = ctrlData.state_mc[ctrlData.state];
  2872.                ctrlData.currentState_mc.visible = true;
  2873.             }
  2874.             applySkinState(ctrlData,ctrlData.state_mc[ctrlData.state]);
  2875.          }
  2876.          else
  2877.          {
  2878.             ctrlData.state = NORMAL_STATE;
  2879.             if(ctrlData.disabled_mc == null)
  2880.             {
  2881.                ctrlData.disabled_mc = setupButtonSkinState(ctrl,ctrl,"disabledLinkageID",ctrlData.state_mc[NORMAL_STATE]);
  2882.             }
  2883.             applySkinState(ctrlData,ctrlData.disabled_mc);
  2884.          }
  2885.       }
  2886.       
  2887.       public function set controlsEnabled(param1:Boolean) : void
  2888.       {
  2889.          if(flvplayback_internal::_controlsEnabled == param1)
  2890.          {
  2891.             return;
  2892.          }
  2893.          _controlsEnabled = param1;
  2894.          var _loc2_:int = 0;
  2895.          while(_loc2_ < NUM_BUTTONS)
  2896.          {
  2897.             skinButtonControl(flvplayback_internal::controls[_loc2_]);
  2898.             _loc2_++;
  2899.          }
  2900.       }
  2901.       
  2902.       flvplayback_internal function setupSkinAutoHide(param1:Boolean) : void
  2903.       {
  2904.          var uiMgr:UIManager = null;
  2905.          var clickHandler:Function = null;
  2906.          var doFade:Boolean = param1;
  2907.          if(flvplayback_internal::_skinAutoHide && flvplayback_internal::skin_mc != null)
  2908.          {
  2909.             if(!flvplayback_internal::hitTarget_mc)
  2910.             {
  2911.                hitTarget_mc = new Sprite();
  2912.                flvplayback_internal::hitTarget_mc.accessibilityProperties = new AccessibilityProperties();
  2913.                flvplayback_internal::hitTarget_mc.accessibilityProperties.name = flvplayback_internal::accessibilityPropertyNames[SHOW_CONTROLS_BUTTON];
  2914.                customClips.push(flvplayback_internal::hitTarget_mc);
  2915.                uiMgr = this;
  2916.                clickHandler = function(param1:*):void
  2917.                {
  2918.                   if(param1.type == FocusEvent.FOCUS_IN)
  2919.                   {
  2920.                      uiMgr._skinAutoHide = false;
  2921.                   }
  2922.                   else if(param1.type == MouseEvent.CLICK)
  2923.                   {
  2924.                      uiMgr._skinAutoHide = !uiMgr._skinAutoHide;
  2925.                   }
  2926.                   uiMgr.setupSkinAutoHide(true);
  2927.                   if(uiMgr._skinAutoHide)
  2928.                   {
  2929.                      param1.target.accessibilityProperties.name = flvplayback_internal::accessibilityPropertyNames[SHOW_CONTROLS_BUTTON];
  2930.                   }
  2931.                   else
  2932.                   {
  2933.                      param1.target.accessibilityProperties.name = flvplayback_internal::accessibilityPropertyNames[HIDE_CONTROLS_BUTTON];
  2934.                   }
  2935.                   if(Accessibility.active)
  2936.                   {
  2937.                      Accessibility.updateProperties();
  2938.                   }
  2939.                };
  2940.                flvplayback_internal::hitTarget_mc.useHandCursor = false;
  2941.                flvplayback_internal::hitTarget_mc.buttonMode = true;
  2942.                flvplayback_internal::hitTarget_mc.tabEnabled = true;
  2943.                flvplayback_internal::hitTarget_mc.tabChildren = true;
  2944.                flvplayback_internal::hitTarget_mc.focusRect = true;
  2945.                flvplayback_internal::hitTarget_mc.addEventListener(FocusEvent.FOCUS_IN,clickHandler);
  2946.                flvplayback_internal::hitTarget_mc.addEventListener(MouseEvent.CLICK,clickHandler);
  2947.                flvplayback_internal::hitTarget_mc.accessibilityProperties.silent = flvplayback_internal::_fullScreen;
  2948.                flvplayback_internal::hitTarget_mc.tabEnabled = !flvplayback_internal::_fullScreen;
  2949.                if(Accessibility.active)
  2950.                {
  2951.                   Accessibility.updateProperties();
  2952.                }
  2953.                flvplayback_internal::_vc.addChild(flvplayback_internal::hitTarget_mc);
  2954.             }
  2955.             flvplayback_internal::hitTarget_mc.graphics.clear();
  2956.             flvplayback_internal::hitTarget_mc.graphics.lineStyle(0,16711680,0);
  2957.             flvplayback_internal::hitTarget_mc.graphics.drawRect(0,0,flvplayback_internal::_vc.width,flvplayback_internal::_vc.height);
  2958.             skinAutoHideHitTest(null,doFade);
  2959.             flvplayback_internal::_skinAutoHideTimer.start();
  2960.          }
  2961.          else
  2962.          {
  2963.             if(flvplayback_internal::skin_mc != null)
  2964.             {
  2965.                if(doFade && flvplayback_internal::_skinFadingMaxTime > 0 && (!flvplayback_internal::skin_mc.visible || flvplayback_internal::skin_mc.alpha < 1) && flvplayback_internal::__visible)
  2966.                {
  2967.                   flvplayback_internal::_skinFadingTimer.stop();
  2968.                   _skinFadeStartTime = getTimer();
  2969.                   _skinFadingIn = true;
  2970.                   if(flvplayback_internal::skin_mc.alpha == 1)
  2971.                   {
  2972.                      flvplayback_internal::skin_mc.alpha = 0;
  2973.                   }
  2974.                   flvplayback_internal::_skinFadingTimer.start();
  2975.                }
  2976.                else if(flvplayback_internal::_skinFadingMaxTime <= 0)
  2977.                {
  2978.                   flvplayback_internal::_skinFadingTimer.stop();
  2979.                   flvplayback_internal::skin_mc.alpha = 1;
  2980.                }
  2981.                flvplayback_internal::skin_mc.visible = flvplayback_internal::__visible;
  2982.             }
  2983.             flvplayback_internal::_skinAutoHideTimer.stop();
  2984.          }
  2985.       }
  2986.       
  2987.       public function get skin() : String
  2988.       {
  2989.          return flvplayback_internal::_skin;
  2990.       }
  2991.       
  2992.       flvplayback_internal function finishAddBarControl(param1:Object) : void
  2993.       {
  2994.          var ctrl:Sprite = null;
  2995.          var e:Event = null;
  2996.          var ctrlOrEvent:Object = param1;
  2997.          if(ctrlOrEvent == null)
  2998.          {
  2999.             return;
  3000.          }
  3001.          if(ctrlOrEvent is Event)
  3002.          {
  3003.             e = Event(ctrlOrEvent);
  3004.             ctrl = Sprite(e.currentTarget);
  3005.             ctrl.removeEventListener(Event.ENTER_FRAME,flvplayback_internal::finishAddBarControl);
  3006.          }
  3007.          else
  3008.          {
  3009.             ctrl = Sprite(ctrlOrEvent);
  3010.          }
  3011.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  3012.          try
  3013.          {
  3014.             if(ctrl["addBarControl"] is Function)
  3015.             {
  3016.                ctrl["addBarControl"]();
  3017.             }
  3018.          }
  3019.          catch(re:ReferenceError)
  3020.          {
  3021.          }
  3022.          ctrlData.origWidth = ctrl.width;
  3023.          ctrlData.origHeight = ctrl.height;
  3024.          fixUpBar(ctrl,"progress",ctrl,"progress_mc");
  3025.          calcBarMargins(ctrl,"progress",false);
  3026.          if(ctrlData.progress_mc != null)
  3027.          {
  3028.             fixUpBar(ctrl,"progressBarFill",ctrlData.progress_mc,"fill_mc");
  3029.             calcBarMargins(ctrlData.progress_mc,"fill",false);
  3030.             calcBarMargins(ctrlData.progress_mc,"mask",false);
  3031.             if(isNaN(flvplayback_internal::_progressPercent))
  3032.             {
  3033.                _progressPercent = !!flvplayback_internal::_vc.isRTMP ? Number(100) : Number(0);
  3034.             }
  3035.             positionBar(ctrl,"progress",flvplayback_internal::_progressPercent);
  3036.          }
  3037.          fixUpBar(ctrl,"fullness",ctrl,"fullness_mc");
  3038.          calcBarMargins(ctrl,"fullness",false);
  3039.          if(ctrlData.fullness_mc != null)
  3040.          {
  3041.             fixUpBar(ctrl,"fullnessBarFill",ctrlData.fullness_mc,"fill_mc");
  3042.             calcBarMargins(ctrlData.fullness_mc,"fill",false);
  3043.             calcBarMargins(ctrlData.fullness_mc,"mask",false);
  3044.          }
  3045.          fixUpBar(ctrl,"hit",ctrl,"hit_mc");
  3046.          fixUpBar(ctrl,"handle",ctrl,"handle_mc");
  3047.          calcBarMargins(ctrl,"handle",true);
  3048.          switch(ctrlData.index)
  3049.          {
  3050.             case SEEK_BAR:
  3051.                setControl(SEEK_BAR_HANDLE,ctrlData.handle_mc);
  3052.                if(ctrlData.hit_mc != null)
  3053.                {
  3054.                   setControl(SEEK_BAR_HIT,ctrlData.hit_mc);
  3055.                }
  3056.                break;
  3057.             case VOLUME_BAR:
  3058.                setControl(VOLUME_BAR_HANDLE,ctrlData.handle_mc);
  3059.                if(ctrlData.hit_mc != null)
  3060.                {
  3061.                   setControl(VOLUME_BAR_HIT,ctrlData.hit_mc);
  3062.                }
  3063.          }
  3064.          positionHandle(ctrl);
  3065.          ctrl.accessibilityProperties = new AccessibilityProperties();
  3066.          ctrl.accessibilityProperties.silent = true;
  3067.       }
  3068.       
  3069.       public function get fullScreenBackgroundColor() : uint
  3070.       {
  3071.          return flvplayback_internal::_fullScreenBgColor;
  3072.       }
  3073.       
  3074.       public function enterFullScreenDisplayState() : void
  3075.       {
  3076.          var theRect:Rectangle = null;
  3077.          var vp:VideoPlayer = null;
  3078.          var effectiveWidth:int = 0;
  3079.          var effectiveHeight:int = 0;
  3080.          var videoAspectRatio:Number = NaN;
  3081.          var screenAspectRatio:Number = NaN;
  3082.          var effectiveMinWidth:int = 0;
  3083.          var effectiveMinHeight:int = 0;
  3084.          var skinScaleMinWidth:int = 0;
  3085.          var skinScaleMinHeight:int = 0;
  3086.          if(!flvplayback_internal::_fullScreen && flvplayback_internal::_vc.stage != null)
  3087.          {
  3088.             if(flvplayback_internal::_fullScreenTakeOver)
  3089.             {
  3090.                try
  3091.                {
  3092.                   theRect = flvplayback_internal::_vc.stage.fullScreenSourceRect;
  3093.                   _fullScreenAccel = true;
  3094.                   vp = flvplayback_internal::_vc.getVideoPlayer(flvplayback_internal::_vc.visibleVideoPlayerIndex);
  3095.                   effectiveWidth = vp.videoWidth;
  3096.                   effectiveHeight = vp.videoHeight;
  3097.                   videoAspectRatio = effectiveWidth / effectiveHeight;
  3098.                   screenAspectRatio = flvplayback_internal::_vc.stage.fullScreenWidth / flvplayback_internal::_vc.stage.fullScreenHeight;
  3099.                   if(videoAspectRatio > screenAspectRatio)
  3100.                   {
  3101.                      effectiveHeight = effectiveWidth / screenAspectRatio;
  3102.                   }
  3103.                   else if(videoAspectRatio < screenAspectRatio)
  3104.                   {
  3105.                      effectiveWidth = effectiveHeight * screenAspectRatio;
  3106.                   }
  3107.                   effectiveMinWidth = flvplayback_internal::fullScreenSourceRectMinWidth;
  3108.                   effectiveMinHeight = flvplayback_internal::fullScreenSourceRectMinHeight;
  3109.                   if(flvplayback_internal::fullScreenSourceRectMinAspectRatio > screenAspectRatio)
  3110.                   {
  3111.                      effectiveMinHeight = effectiveMinWidth / screenAspectRatio;
  3112.                   }
  3113.                   else if(flvplayback_internal::fullScreenSourceRectMinAspectRatio < screenAspectRatio)
  3114.                   {
  3115.                      effectiveMinWidth = effectiveMinHeight * screenAspectRatio;
  3116.                   }
  3117.                   skinScaleMinWidth = flvplayback_internal::_vc.stage.fullScreenWidth / flvplayback_internal::_skinScaleMaximum;
  3118.                   skinScaleMinHeight = flvplayback_internal::_vc.stage.fullScreenHeight / flvplayback_internal::_skinScaleMaximum;
  3119.                   if(effectiveMinWidth < skinScaleMinWidth || effectiveMinHeight < skinScaleMinHeight)
  3120.                   {
  3121.                      effectiveMinWidth = skinScaleMinWidth;
  3122.                      effectiveMinHeight = skinScaleMinHeight;
  3123.                   }
  3124.                   if(effectiveWidth < effectiveMinWidth || effectiveHeight < effectiveMinHeight)
  3125.                   {
  3126.                      effectiveWidth = effectiveMinWidth;
  3127.                      effectiveHeight = effectiveMinHeight;
  3128.                   }
  3129.                   flvplayback_internal::_vc.stage.fullScreenSourceRect = new Rectangle(0,0,effectiveWidth,effectiveHeight);
  3130.                   flvplayback_internal::_vc.stage.displayState = StageDisplayState.FULL_SCREEN;
  3131.                }
  3132.                catch(re:ReferenceError)
  3133.                {
  3134.                   _fullScreenAccel = false;
  3135.                }
  3136.                catch(re:SecurityError)
  3137.                {
  3138.                   _fullScreenAccel = false;
  3139.                }
  3140.             }
  3141.             try
  3142.             {
  3143.                flvplayback_internal::_vc.stage.displayState = StageDisplayState.FULL_SCREEN;
  3144.             }
  3145.             catch(se:SecurityError)
  3146.             {
  3147.             }
  3148.          }
  3149.       }
  3150.       
  3151.       flvplayback_internal function setupBarSkinPart(param1:Sprite, param2:DisplayObject, param3:Sprite, param4:String, param5:String, param6:Boolean = false) : DisplayObject
  3152.       {
  3153.          var part:DisplayObject = null;
  3154.          var partAvatar:DisplayObject = null;
  3155.          var ctrlData:ControlData = null;
  3156.          var partData:ControlData = null;
  3157.          var ctrl:Sprite = param1;
  3158.          var avatar:DisplayObject = param2;
  3159.          var definitionHolder:Sprite = param3;
  3160.          var skinName:String = param4;
  3161.          var partName:String = param5;
  3162.          var required:Boolean = param6;
  3163.          try
  3164.          {
  3165.             part = ctrl[partName];
  3166.          }
  3167.          catch(re:ReferenceError)
  3168.          {
  3169.             part = null;
  3170.          }
  3171.          if(part == null)
  3172.          {
  3173.             try
  3174.             {
  3175.                part = createSkin(definitionHolder,skinName);
  3176.             }
  3177.             catch(ve:VideoError)
  3178.             {
  3179.                if(required)
  3180.                {
  3181.                   throw ve;
  3182.                }
  3183.             }
  3184.             if(part != null)
  3185.             {
  3186.                flvplayback_internal::skin_mc.addChild(part);
  3187.                part.x = ctrl.x;
  3188.                part.y = ctrl.y;
  3189.                partAvatar = flvplayback_internal::layout_mc.getChildByName(skinName + "_mc");
  3190.                if(partAvatar != null)
  3191.                {
  3192.                   if(partName == "hit_mc")
  3193.                   {
  3194.                      ctrlData = ctrlDataDict[ctrl];
  3195.                      partData = new ControlData(this,part,flvplayback_internal::controls[ctrlData.index],-1);
  3196.                      partData.avatar = partAvatar;
  3197.                      ctrlDataDict[part] = partData;
  3198.                   }
  3199.                   else
  3200.                   {
  3201.                      part.x += partAvatar.x - avatar.x;
  3202.                      part.y += partAvatar.y - avatar.y;
  3203.                      part.width = partAvatar.width;
  3204.                      part.height = partAvatar.height;
  3205.                   }
  3206.                   if(part is InteractiveObject && partAvatar is InteractiveObject)
  3207.                   {
  3208.                      InteractiveObject(part).tabIndex = InteractiveObject(partAvatar).tabIndex;
  3209.                   }
  3210.                }
  3211.             }
  3212.          }
  3213.          if(required && part == null)
  3214.          {
  3215.             throw new VideoError(VideoError.MISSING_SKIN_STYLE,skinName);
  3216.          }
  3217.          if(part != null)
  3218.          {
  3219.             part.accessibilityProperties = new AccessibilityProperties();
  3220.             part.accessibilityProperties.silent = true;
  3221.          }
  3222.          return part;
  3223.       }
  3224.       
  3225.       flvplayback_internal function startHandleDrag(param1:Sprite) : void
  3226.       {
  3227.          var ctrl:Sprite = param1;
  3228.          if(ctrl == null)
  3229.          {
  3230.             return;
  3231.          }
  3232.          var ctrlData:ControlData = ctrlDataDict[ctrl];
  3233.          try
  3234.          {
  3235.             if(ctrl["startHandleDrag"] is Function && ctrl["startHandleDrag"]())
  3236.             {
  3237.                ctrlData.isDragging = true;
  3238.                return;
  3239.             }
  3240.          }
  3241.          catch(re:ReferenceError)
  3242.          {
  3243.          }
  3244.          var handle:Sprite = ctrlData.handle_mc;
  3245.          if(handle == null)
  3246.          {
  3247.             return;
  3248.          }
  3249.          var handleData:ControlData = ctrlDataDict[handle];
  3250.          var theY:Number = ctrl.y + handleData.origY;
  3251.          var theWidth:Number = !!isNaN(ctrlData.origWidth) ? Number(ctrl.width) : Number(ctrlData.origWidth);
  3252.          var bounds:Rectangle = new Rectangle(ctrl.x + handleData.leftMargin,theY,theWidth - handleData.rightMargin,0);
  3253.          handle.startDrag(false,bounds);
  3254.          ctrlData.isDragging = true;
  3255.          handle.focusRect = false;
  3256.          handle.stage.focus = handle;
  3257.       }
  3258.       
  3259.       public function get skinBackgroundAlpha() : Number
  3260.       {
  3261.          return flvplayback_internal::borderAlpha;
  3262.       }
  3263.       
  3264.       public function get volumeBarScrubTolerance() : Number
  3265.       {
  3266.          return flvplayback_internal::_volumeBarScrubTolerance;
  3267.       }
  3268.       
  3269.       public function get skinScaleMaximum() : Number
  3270.       {
  3271.          return flvplayback_internal::_skinScaleMaximum;
  3272.       }
  3273.       
  3274.       public function get skinBackgroundColor() : uint
  3275.       {
  3276.          return flvplayback_internal::borderColor;
  3277.       }
  3278.       
  3279.       public function get controlsEnabled() : Boolean
  3280.       {
  3281.          return flvplayback_internal::_controlsEnabled;
  3282.       }
  3283.       
  3284.       flvplayback_internal function handleKeyEvent(param1:KeyboardEvent) : void
  3285.       {
  3286.          var ctrlData:ControlData = null;
  3287.          var focusControl:InteractiveObject = null;
  3288.          var percent:Number = NaN;
  3289.          var nearestCuePoint:Object = null;
  3290.          var nextCuePoint:Object = null;
  3291.          var wasMuted:Boolean = false;
  3292.          var num:Number = NaN;
  3293.          var ctrl:Sprite = null;
  3294.          var setFocusedControl:Function = null;
  3295.          var event:KeyboardEvent = param1;
  3296.          ctrlData = ctrlDataDict[event.currentTarget];
  3297.          var k:int = event.keyCode;
  3298.          var ka:int = event.charCode;
  3299.          var kaBool:Boolean = ka >= 48 && ka <= 57;
  3300.          ka = int(String.fromCharCode(event.charCode));
  3301.          switch(event.type)
  3302.          {
  3303.             case KeyboardEvent.KEY_DOWN:
  3304.                switch(event.target)
  3305.                {
  3306.                   case flvplayback_internal::controls[SEEK_BAR_HANDLE]:
  3307.                   case flvplayback_internal::controls[VOLUME_BAR_HANDLE]:
  3308.                      if(k != Keyboard.TAB && (k == Keyboard.UP || k == Keyboard.DOWN || k == Keyboard.LEFT || k == Keyboard.RIGHT || k == Keyboard.PAGE_UP || k == Keyboard.PAGE_DOWN || k == Keyboard.HOME || k == Keyboard.END || !isNaN(ka) && kaBool))
  3309.                      {
  3310.                         focusControl = event.target as InteractiveObject;
  3311.                         focusControl.stage.focus = focusControl;
  3312.                         if(event.target == flvplayback_internal::controls[SEEK_BAR_HANDLE])
  3313.                         {
  3314.                            percent = flvplayback_internal::_vc.playheadPercentage;
  3315.                            nearestCuePoint = flvplayback_internal::_vc.findNearestCuePoint(flvplayback_internal::_vc.playheadTime);
  3316.                            if(k == Keyboard.LEFT || k == Keyboard.DOWN)
  3317.                            {
  3318.                               percent -= flvplayback_internal::_vc.seekBarScrubTolerance * 2;
  3319.                               flvplayback_internal::_vc.playheadPercentage = Math.max(percent,0);
  3320.                            }
  3321.                            else if(k == Keyboard.RIGHT || k == Keyboard.UP)
  3322.                            {
  3323.                               if(flvplayback_internal::_vc.playheadPercentage >= 99)
  3324.                               {
  3325.                                  return;
  3326.                               }
  3327.                               if(nearestCuePoint != null && nearestCuePoint.index < (nearestCuePoint.array as Array).length - 1)
  3328.                               {
  3329.                                  try
  3330.                                  {
  3331.                                     nextCuePoint = flvplayback_internal::_vc.findCuePoint(nearestCuePoint.array[nearestCuePoint.index + 1]);
  3332.                                     if(nextCuePoint && flvplayback_internal::_vc.isFLVCuePointEnabled(nextCuePoint))
  3333.                                     {
  3334.                                        if(isNaN(Number(flvplayback_internal::_vc.metadata.videocodecid)))
  3335.                                        {
  3336.                                           flvplayback_internal::_vc.playheadPercentage = Math.max(nextCuePoint.time / flvplayback_internal::_vc.totalTime * 100,Math.min(99,flvplayback_internal::_vc.playheadPercentage + flvplayback_internal::_vc.seekBarScrubTolerance * 2));
  3337.                                        }
  3338.                                        else
  3339.                                        {
  3340.                                           flvplayback_internal::_vc.playheadTime = nextCuePoint.time;
  3341.                                        }
  3342.                                     }
  3343.                                  }
  3344.                                  catch(err:Error)
  3345.                                  {
  3346.                                  }
  3347.                               }
  3348.                               else
  3349.                               {
  3350.                                  percent += flvplayback_internal::_vc.seekBarScrubTolerance;
  3351.                                  flvplayback_internal::_vc.playheadPercentage = Math.min(99,percent);
  3352.                               }
  3353.                            }
  3354.                            else if(k == Keyboard.PAGE_UP || k == Keyboard.HOME)
  3355.                            {
  3356.                               flvplayback_internal::_vc.playheadPercentage = 0;
  3357.                            }
  3358.                            else if(k == Keyboard.PAGE_DOWN || k == Keyboard.END)
  3359.                            {
  3360.                               flvplayback_internal::_vc.playheadPercentage = 99;
  3361.                            }
  3362.                         }
  3363.                         else
  3364.                         {
  3365.                            wasMuted = flvplayback_internal::_isMuted;
  3366.                            num = !!flvplayback_internal::_isMuted ? Number(Math.round(flvplayback_internal::cachedSoundLevel * 1000) / 100) : Number(Math.round(flvplayback_internal::_vc.volume * 1000) / 100);
  3367.                            if(k == Keyboard.LEFT || k == Keyboard.DOWN)
  3368.                            {
  3369.                               if(Math.floor(num) != num)
  3370.                               {
  3371.                                  flvplayback_internal::_vc.volume = Math.floor(num) / 10;
  3372.                               }
  3373.                               else
  3374.                               {
  3375.                                  flvplayback_internal::_vc.volume = Math.max(0,(num - 1) / 10);
  3376.                               }
  3377.                            }
  3378.                            else if(k == Keyboard.RIGHT || k == Keyboard.UP)
  3379.                            {
  3380.                               if(Math.round(num) != num)
  3381.                               {
  3382.                                  flvplayback_internal::_vc.volume = Math.round(num) / 10;
  3383.                               }
  3384.                               else
  3385.                               {
  3386.                                  flvplayback_internal::_vc.volume = Math.min(1,(num + 1) / 10);
  3387.                               }
  3388.                            }
  3389.                            else if(k == Keyboard.PAGE_UP || k == Keyboard.HOME)
  3390.                            {
  3391.                               flvplayback_internal::_vc.volume = 1;
  3392.                            }
  3393.                            else if(k == Keyboard.PAGE_DOWN || k == Keyboard.END)
  3394.                            {
  3395.                               flvplayback_internal::_vc.volume = 0;
  3396.                            }
  3397.                            else if(!isNaN(ka) && kaBool)
  3398.                            {
  3399.                               flvplayback_internal::_vc.volume = Math.min(1,(ka + 1) / 10);
  3400.                            }
  3401.                            cachedSoundLevel = flvplayback_internal::_vc.volume;
  3402.                            if(wasMuted)
  3403.                            {
  3404.                               _isMuted = true;
  3405.                               cachedSoundLevel = flvplayback_internal::_vc.volume;
  3406.                               flvplayback_internal::_vc.volume = 0;
  3407.                               setEnabledAndVisibleForState(MUTE_OFF_BUTTON,VideoState.PLAYING);
  3408.                               skinButtonControl(flvplayback_internal::controls[MUTE_OFF_BUTTON]);
  3409.                               setEnabledAndVisibleForState(MUTE_ON_BUTTON,VideoState.PLAYING);
  3410.                               skinButtonControl(flvplayback_internal::controls[MUTE_ON_BUTTON]);
  3411.                            }
  3412.                         }
  3413.                      }
  3414.                      break;
  3415.                   case flvplayback_internal::controls[PAUSE_BUTTON]:
  3416.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3417.                      {
  3418.                         ctrlData.state = DOWN_STATE;
  3419.                         if(!event.target.focusRect)
  3420.                         {
  3421.                            dispatchMessage(ctrlData.index);
  3422.                         }
  3423.                         focusControl = flvplayback_internal::controls[PLAY_BUTTON] as InteractiveObject;
  3424.                      }
  3425.                      break;
  3426.                   case flvplayback_internal::controls[PLAY_BUTTON]:
  3427.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3428.                      {
  3429.                         ctrlData.state = DOWN_STATE;
  3430.                         if(!event.target.focusRect)
  3431.                         {
  3432.                            dispatchMessage(ctrlData.index);
  3433.                         }
  3434.                         focusControl = flvplayback_internal::controls[PAUSE_BUTTON] as InteractiveObject;
  3435.                      }
  3436.                      break;
  3437.                   case flvplayback_internal::controls[STOP_BUTTON]:
  3438.                   case flvplayback_internal::controls[BACK_BUTTON]:
  3439.                   case flvplayback_internal::controls[FORWARD_BUTTON]:
  3440.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3441.                      {
  3442.                         ctrlData.state = DOWN_STATE;
  3443.                         event.target.tabEnabled = true;
  3444.                         if(!event.target.focusRect)
  3445.                         {
  3446.                            dispatchMessage(ctrlData.index);
  3447.                         }
  3448.                         focusControl = event.target as InteractiveObject;
  3449.                      }
  3450.                      break;
  3451.                   case flvplayback_internal::controls[MUTE_ON_BUTTON]:
  3452.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3453.                      {
  3454.                         ctrlData.state = DOWN_STATE;
  3455.                         if(!event.target.focusRect)
  3456.                         {
  3457.                            dispatchMessage(ctrlData.index);
  3458.                         }
  3459.                         focusControl = flvplayback_internal::controls[MUTE_OFF_BUTTON] as InteractiveObject;
  3460.                      }
  3461.                      break;
  3462.                   case flvplayback_internal::controls[MUTE_OFF_BUTTON]:
  3463.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3464.                      {
  3465.                         ctrlData.state = DOWN_STATE;
  3466.                         if(!event.target.focusRect)
  3467.                         {
  3468.                            dispatchMessage(ctrlData.index);
  3469.                         }
  3470.                         focusControl = flvplayback_internal::controls[MUTE_ON_BUTTON] as InteractiveObject;
  3471.                      }
  3472.                      break;
  3473.                   case flvplayback_internal::controls[FULL_SCREEN_ON_BUTTON]:
  3474.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3475.                      {
  3476.                         ctrlData.state = DOWN_STATE;
  3477.                         dispatchMessage(FULL_SCREEN_ON_BUTTON);
  3478.                      }
  3479.                      break;
  3480.                   case flvplayback_internal::controls[FULL_SCREEN_OFF_BUTTON]:
  3481.                      if(k == Keyboard.SPACE || k == Keyboard.ENTER)
  3482.                      {
  3483.                         ctrlData.state = DOWN_STATE;
  3484.                         dispatchMessage(FULL_SCREEN_OFF_BUTTON);
  3485.                      }
  3486.                }
  3487.                skinButtonControl(event.currentTarget);
  3488.                break;
  3489.             case KeyboardEvent.KEY_UP:
  3490.                switch(event.target)
  3491.                {
  3492.                   case flvplayback_internal::controls[SEEK_BAR_HANDLE]:
  3493.                   case flvplayback_internal::controls[VOLUME_BAR_HANDLE]:
  3494.                      if(k != Keyboard.TAB && (k == Keyboard.UP || k == Keyboard.DOWN || k == Keyboard.LEFT || k == Keyboard.RIGHT || k == Keyboard.PAGE_UP || k == Keyboard.PAGE_DOWN || k == Keyboard.HOME || k == Keyboard.END))
  3495.                      {
  3496.                         focusControl = event.target as InteractiveObject;
  3497.                         focusControl.stage.focus = focusControl;
  3498.                      }
  3499.                      break;
  3500.                   default:
  3501.                      ctrlData.state = OVER_STATE;
  3502.                }
  3503.          }
  3504.          if(focusControl != null)
  3505.          {
  3506.             if(focusControl.visible)
  3507.             {
  3508.                ctrlData.state = NORMAL_STATE;
  3509.                if(!focusControl.tabEnabled)
  3510.                {
  3511.                   focusControl.tabEnabled = true;
  3512.                }
  3513.                focusControl.stage.focus = focusControl;
  3514.             }
  3515.             else
  3516.             {
  3517.                ctrl = event.currentTarget as Sprite;
  3518.                setFocusedControl = function(param1:Event):void
  3519.                {
  3520.                   if(param1.target.visible)
  3521.                   {
  3522.                      ctrlData.state = NORMAL_STATE;
  3523.                      if(!param1.target.tabEnabled)
  3524.                      {
  3525.                         param1.target.tabEnabled = true;
  3526.                      }
  3527.                      param1.target.stage.focus = param1.target;
  3528.                      param1.target.removeEventListener(Event.ENTER_FRAME,setFocusedControl);
  3529.                   }
  3530.                };
  3531.                focusControl.addEventListener(Event.ENTER_FRAME,setFocusedControl);
  3532.             }
  3533.          }
  3534.       }
  3535.       
  3536.       flvplayback_internal function handleIVPEvent(param1:IVPEvent) : void
  3537.       {
  3538.          var _loc3_:int = 0;
  3539.          var _loc4_:VideoEvent = null;
  3540.          var _loc5_:Sprite = null;
  3541.          var _loc6_:ControlData = null;
  3542.          var _loc7_:VideoProgressEvent = null;
  3543.          var _loc8_:VideoPlayerState = null;
  3544.          var _loc9_:Number = NaN;
  3545.          var _loc10_:Number = NaN;
  3546.          var _loc11_:Number = NaN;
  3547.          if(param1.vp != flvplayback_internal::_vc.visibleVideoPlayerIndex)
  3548.          {
  3549.             return;
  3550.          }
  3551.          var _loc2_:uint = flvplayback_internal::_vc.activeVideoPlayerIndex;
  3552.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  3553.          switch(param1.type)
  3554.          {
  3555.             case VideoEvent.STATE_CHANGE:
  3556.                if((_loc4_ = VideoEvent(param1)).state == VideoState.BUFFERING)
  3557.                {
  3558.                   if(!flvplayback_internal::_bufferingOn)
  3559.                   {
  3560.                      flvplayback_internal::_bufferingDelayTimer.reset();
  3561.                      flvplayback_internal::_bufferingDelayTimer.start();
  3562.                   }
  3563.                }
  3564.                else
  3565.                {
  3566.                   flvplayback_internal::_bufferingDelayTimer.reset();
  3567.                   _bufferingOn = false;
  3568.                }
  3569.                if(_loc4_.state == VideoState.LOADING)
  3570.                {
  3571.                   _progressPercent = !!flvplayback_internal::_vc.getVideoPlayer(param1.vp).isRTMP ? Number(100) : Number(0);
  3572.                   _loc3_ = SEEK_BAR;
  3573.                   while(_loc3_ <= VOLUME_BAR)
  3574.                   {
  3575.                      _loc5_ = flvplayback_internal::controls[_loc3_];
  3576.                      if(flvplayback_internal::controls[_loc3_] != null)
  3577.                      {
  3578.                         if((_loc6_ = ctrlDataDict[_loc5_]).progress_mc != null)
  3579.                         {
  3580.                            positionBar(_loc5_,"progress",flvplayback_internal::_progressPercent);
  3581.                         }
  3582.                      }
  3583.                      _loc3_++;
  3584.                   }
  3585.                }
  3586.                _loc3_ = 0;
  3587.                while(_loc3_ < NUM_CONTROLS)
  3588.                {
  3589.                   if(flvplayback_internal::controls[_loc3_] != undefined)
  3590.                   {
  3591.                      setEnabledAndVisibleForState(_loc3_,_loc4_.state);
  3592.                      if(_loc3_ < NUM_BUTTONS)
  3593.                      {
  3594.                         skinButtonControl(flvplayback_internal::controls[_loc3_]);
  3595.                      }
  3596.                   }
  3597.                   _loc3_++;
  3598.                }
  3599.                break;
  3600.             case VideoEvent.READY:
  3601.             case MetadataEvent.METADATA_RECEIVED:
  3602.                _loc3_ = 0;
  3603.                while(_loc3_ < NUM_CONTROLS)
  3604.                {
  3605.                   if(flvplayback_internal::controls[_loc3_] != undefined)
  3606.                   {
  3607.                      setEnabledAndVisibleForState(_loc3_,flvplayback_internal::_vc.state);
  3608.                      if(_loc3_ < NUM_BUTTONS)
  3609.                      {
  3610.                         skinButtonControl(flvplayback_internal::controls[_loc3_]);
  3611.                      }
  3612.                   }
  3613.                   _loc3_++;
  3614.                }
  3615.                if(flvplayback_internal::_vc.getVideoPlayer(param1.vp).isRTMP)
  3616.                {
  3617.                   _progressPercent = 100;
  3618.                   _loc3_ = SEEK_BAR;
  3619.                   while(_loc3_ <= VOLUME_BAR)
  3620.                   {
  3621.                      if((_loc5_ = flvplayback_internal::controls[_loc3_]) != null)
  3622.                      {
  3623.                         if((_loc6_ = ctrlDataDict[_loc5_]).progress_mc != null)
  3624.                         {
  3625.                            positionBar(_loc5_,"progress",flvplayback_internal::_progressPercent);
  3626.                         }
  3627.                      }
  3628.                      _loc3_++;
  3629.                   }
  3630.                }
  3631.                break;
  3632.             case VideoEvent.PLAYHEAD_UPDATE:
  3633.                if(flvplayback_internal::controls[SEEK_BAR] != undefined && !flvplayback_internal::_vc.isLive && !isNaN(flvplayback_internal::_vc.totalTime) && flvplayback_internal::_vc.getVideoPlayer(flvplayback_internal::_vc.visibleVideoPlayerIndex).state != VideoState.SEEKING)
  3634.                {
  3635.                   if((_loc10_ = (_loc4_ = VideoEvent(param1)).playheadTime / flvplayback_internal::_vc.totalTime * 100) < 0)
  3636.                   {
  3637.                      _loc10_ = 0;
  3638.                   }
  3639.                   else if(_loc10_ > 100)
  3640.                   {
  3641.                      _loc10_ = 100;
  3642.                   }
  3643.                   _loc5_ = flvplayback_internal::controls[SEEK_BAR];
  3644.                   (_loc6_ = ctrlDataDict[_loc5_]).percentage = _loc10_;
  3645.                   positionHandle(_loc5_);
  3646.                }
  3647.                break;
  3648.             case VideoProgressEvent.PROGRESS:
  3649.                _loc7_ = VideoProgressEvent(param1);
  3650.                _progressPercent = _loc7_.bytesTotal <= 0 ? Number(100) : Number(_loc7_.bytesLoaded / _loc7_.bytesTotal * 100);
  3651.                _loc9_ = (_loc8_ = flvplayback_internal::_vc.videoPlayerStates[param1.vp]).minProgressPercent;
  3652.                if(!isNaN(_loc9_) && _loc9_ > flvplayback_internal::_progressPercent)
  3653.                {
  3654.                   _progressPercent = _loc9_;
  3655.                }
  3656.                if(!isNaN(flvplayback_internal::_vc.totalTime))
  3657.                {
  3658.                   if((_loc11_ = flvplayback_internal::_vc.playheadTime / flvplayback_internal::_vc.totalTime * 100) > flvplayback_internal::_progressPercent)
  3659.                   {
  3660.                      _progressPercent = _loc11_;
  3661.                      _loc8_.minProgressPercent = flvplayback_internal::_progressPercent;
  3662.                   }
  3663.                }
  3664.                _loc3_ = SEEK_BAR;
  3665.                while(_loc3_ <= VOLUME_BAR)
  3666.                {
  3667.                   if((_loc5_ = flvplayback_internal::controls[_loc3_]) != null)
  3668.                   {
  3669.                      if((_loc6_ = ctrlDataDict[_loc5_]).progress_mc != null)
  3670.                      {
  3671.                         positionBar(_loc5_,"progress",flvplayback_internal::_progressPercent);
  3672.                      }
  3673.                   }
  3674.                   _loc3_++;
  3675.                }
  3676.          }
  3677.          flvplayback_internal::_vc.activeVideoPlayerIndex = _loc2_;
  3678.       }
  3679.       
  3680.       flvplayback_internal function layoutSkin() : void
  3681.       {
  3682.          var i:int = 0;
  3683.          var borderRect:Rectangle = null;
  3684.          var forceSkinAutoHide:Boolean = false;
  3685.          var minWidth:Number = NaN;
  3686.          var vidWidth:Number = NaN;
  3687.          var minHeight:Number = NaN;
  3688.          var vidHeight:Number = NaN;
  3689.          if(flvplayback_internal::layout_mc == null)
  3690.          {
  3691.             return;
  3692.          }
  3693.          if(flvplayback_internal::skinLoadDelayCount < 2)
  3694.          {
  3695.             return;
  3696.          }
  3697.          var video_mc:DisplayObject = flvplayback_internal::layout_mc["video_mc"];
  3698.          if(video_mc == null)
  3699.          {
  3700.             throw new Error("No layout_mc.video_mc");
  3701.          }
  3702.          placeholderLeft = video_mc.x;
  3703.          placeholderRight = video_mc.x + video_mc.width;
  3704.          placeholderTop = video_mc.y;
  3705.          placeholderBottom = video_mc.y + video_mc.height;
  3706.          videoLeft = flvplayback_internal::_vc.x - flvplayback_internal::_vc.registrationX;
  3707.          videoRight = flvplayback_internal::videoLeft + flvplayback_internal::_vc.width;
  3708.          videoTop = flvplayback_internal::_vc.y - flvplayback_internal::_vc.registrationY;
  3709.          videoBottom = flvplayback_internal::videoTop + flvplayback_internal::_vc.height;
  3710.          if(flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenTakeOver && flvplayback_internal::border_mc != null)
  3711.          {
  3712.             borderRect = calcLayoutControl(flvplayback_internal::border_mc);
  3713.             forceSkinAutoHide = false;
  3714.             if(borderRect.width > 0 && borderRect.height > 0)
  3715.             {
  3716.                if(borderRect.x < 0)
  3717.                {
  3718.                   placeholderLeft += flvplayback_internal::videoLeft - borderRect.x;
  3719.                   forceSkinAutoHide = true;
  3720.                }
  3721.                if(borderRect.x + borderRect.width > flvplayback_internal::_vc.registrationWidth)
  3722.                {
  3723.                   placeholderRight += borderRect.x + borderRect.width - flvplayback_internal::videoRight;
  3724.                   forceSkinAutoHide = true;
  3725.                }
  3726.                if(borderRect.y < 0)
  3727.                {
  3728.                   placeholderTop += flvplayback_internal::videoTop - borderRect.y;
  3729.                   forceSkinAutoHide = true;
  3730.                }
  3731.                if(borderRect.y + borderRect.height > flvplayback_internal::_vc.registrationHeight)
  3732.                {
  3733.                   placeholderBottom += borderRect.y + borderRect.height - flvplayback_internal::videoBottom;
  3734.                   forceSkinAutoHide = true;
  3735.                }
  3736.                if(forceSkinAutoHide)
  3737.                {
  3738.                   _skinAutoHide = true;
  3739.                   setupSkinAutoHide(true);
  3740.                }
  3741.             }
  3742.          }
  3743.          try
  3744.          {
  3745.             if(!isNaN(flvplayback_internal::layout_mc["minWidth"]))
  3746.             {
  3747.                minWidth = flvplayback_internal::layout_mc["minWidth"];
  3748.                vidWidth = flvplayback_internal::videoRight - flvplayback_internal::videoLeft;
  3749.                if(minWidth > 0 && minWidth > vidWidth)
  3750.                {
  3751.                   videoLeft -= (minWidth - vidWidth) / 2;
  3752.                   videoRight = minWidth + flvplayback_internal::videoLeft;
  3753.                }
  3754.             }
  3755.          }
  3756.          catch(re1:ReferenceError)
  3757.          {
  3758.          }
  3759.          try
  3760.          {
  3761.             if(!isNaN(flvplayback_internal::layout_mc["minHeight"]))
  3762.             {
  3763.                minHeight = flvplayback_internal::layout_mc["minHeight"];
  3764.                vidHeight = flvplayback_internal::videoBottom - flvplayback_internal::videoTop;
  3765.                if(minHeight > 0 && minHeight > vidHeight)
  3766.                {
  3767.                   videoTop -= (minHeight - vidHeight) / 2;
  3768.                   videoBottom = minHeight + flvplayback_internal::videoTop;
  3769.                }
  3770.             }
  3771.          }
  3772.          catch(re2:ReferenceError)
  3773.          {
  3774.          }
  3775.          i = 0;
  3776.          while(i < customClips.length)
  3777.          {
  3778.             layoutControl(customClips[i]);
  3779.             if(customClips[i] == flvplayback_internal::border_mc)
  3780.             {
  3781.                bitmapCopyBorder();
  3782.             }
  3783.             i++;
  3784.          }
  3785.          i = 0;
  3786.          while(i < NUM_CONTROLS)
  3787.          {
  3788.             layoutControl(flvplayback_internal::controls[i]);
  3789.             i++;
  3790.          }
  3791.       }
  3792.       
  3793.       public function set bufferingDelayInterval(param1:Number) : void
  3794.       {
  3795.          if(flvplayback_internal::_bufferingDelayTimer.delay == param1)
  3796.          {
  3797.             return;
  3798.          }
  3799.          flvplayback_internal::_bufferingDelayTimer.delay = param1;
  3800.       }
  3801.       
  3802.       flvplayback_internal function setupButtonSkinState(param1:Sprite, param2:Sprite, param3:String, param4:DisplayObject = null) : DisplayObject
  3803.       {
  3804.          var stateSkin:DisplayObject = null;
  3805.          var ctrl:Sprite = param1;
  3806.          var definitionHolder:Sprite = param2;
  3807.          var skinName:String = param3;
  3808.          var defaultSkin:DisplayObject = param4;
  3809.          try
  3810.          {
  3811.             stateSkin = createSkin(definitionHolder,skinName);
  3812.          }
  3813.          catch(ve:VideoError)
  3814.          {
  3815.             if(defaultSkin == null)
  3816.             {
  3817.                throw ve;
  3818.             }
  3819.             stateSkin = null;
  3820.          }
  3821.          if(stateSkin != null)
  3822.          {
  3823.             stateSkin.visible = false;
  3824.             ctrl.addChild(stateSkin);
  3825.          }
  3826.          else if(defaultSkin != null)
  3827.          {
  3828.             stateSkin = defaultSkin;
  3829.          }
  3830.          return stateSkin;
  3831.       }
  3832.       
  3833.       flvplayback_internal function setEnabledAndVisibleForState(param1:int, param2:String) : void
  3834.       {
  3835.          var _loc6_:ControlData = null;
  3836.          var _loc7_:Boolean = false;
  3837.          var _loc8_:ControlData = null;
  3838.          var _loc9_:ControlData = null;
  3839.          var _loc10_:ControlData = null;
  3840.          var _loc11_:ControlData = null;
  3841.          var _loc3_:int = flvplayback_internal::_vc.activeVideoPlayerIndex;
  3842.          flvplayback_internal::_vc.activeVideoPlayerIndex = flvplayback_internal::_vc.visibleVideoPlayerIndex;
  3843.          var _loc4_:String;
  3844.          if((_loc4_ = param2) == VideoState.BUFFERING && !flvplayback_internal::_bufferingOn)
  3845.          {
  3846.             _loc4_ = VideoState.PLAYING;
  3847.          }
  3848.          var _loc5_:Sprite;
  3849.          if((_loc5_ = flvplayback_internal::controls[param1]) == null)
  3850.          {
  3851.             return;
  3852.          }
  3853.          if((_loc6_ = ctrlDataDict[_loc5_]) == null)
  3854.          {
  3855.             return;
  3856.          }
  3857.          switch(param1)
  3858.          {
  3859.             case VOLUME_BAR:
  3860.             case VOLUME_BAR_HANDLE:
  3861.             case VOLUME_BAR_HIT:
  3862.                _loc6_.enabled = true;
  3863.                break;
  3864.             case FULL_SCREEN_ON_BUTTON:
  3865.                _loc6_.enabled = !flvplayback_internal::_fullScreen;
  3866.                if(flvplayback_internal::controls[FULL_SCREEN_BUTTON] != undefined)
  3867.                {
  3868.                   _loc5_.visible = _loc6_.enabled;
  3869.                }
  3870.                break;
  3871.             case FULL_SCREEN_OFF_BUTTON:
  3872.                _loc6_.enabled = flvplayback_internal::_fullScreen;
  3873.                if(flvplayback_internal::controls[FULL_SCREEN_BUTTON] != undefined)
  3874.                {
  3875.                   _loc5_.visible = _loc6_.enabled;
  3876.                }
  3877.                break;
  3878.             case MUTE_ON_BUTTON:
  3879.                _loc6_.enabled = !flvplayback_internal::_isMuted;
  3880.                if(flvplayback_internal::controls[MUTE_BUTTON] != undefined)
  3881.                {
  3882.                   _loc5_.visible = _loc6_.enabled;
  3883.                }
  3884.                break;
  3885.             case MUTE_OFF_BUTTON:
  3886.                _loc6_.enabled = flvplayback_internal::_isMuted;
  3887.                if(flvplayback_internal::controls[MUTE_BUTTON] != undefined)
  3888.                {
  3889.                   _loc5_.visible = _loc6_.enabled;
  3890.                }
  3891.                break;
  3892.             default:
  3893.                switch(_loc4_)
  3894.                {
  3895.                   case VideoState.LOADING:
  3896.                   case VideoState.CONNECTION_ERROR:
  3897.                      _loc6_.enabled = false;
  3898.                      break;
  3899.                   case VideoState.DISCONNECTED:
  3900.                      _loc6_.enabled = flvplayback_internal::_vc.source != null && flvplayback_internal::_vc.source != "";
  3901.                      break;
  3902.                   case VideoState.SEEKING:
  3903.                      break;
  3904.                   default:
  3905.                      _loc6_.enabled = true;
  3906.                }
  3907.          }
  3908.          switch(param1)
  3909.          {
  3910.             case SEEK_BAR:
  3911.                switch(_loc4_)
  3912.                {
  3913.                   case VideoState.STOPPED:
  3914.                   case VideoState.PLAYING:
  3915.                   case VideoState.PAUSED:
  3916.                   case VideoState.REWINDING:
  3917.                   case VideoState.SEEKING:
  3918.                      _loc6_.enabled = true;
  3919.                      break;
  3920.                   case VideoState.BUFFERING:
  3921.                      _loc6_.enabled = !flvplayback_internal::_bufferingBarHides || flvplayback_internal::controls[BUFFERING_BAR] == undefined;
  3922.                      break;
  3923.                   default:
  3924.                      _loc6_.enabled = false;
  3925.                }
  3926.                if(_loc6_.enabled)
  3927.                {
  3928.                   _loc6_.enabled = !isNaN(flvplayback_internal::_vc.totalTime);
  3929.                }
  3930.                if(_loc6_.handle_mc != null)
  3931.                {
  3932.                   (_loc8_ = ctrlDataDict[_loc6_.handle_mc]).enabled = _loc6_.enabled;
  3933.                   _loc6_.handle_mc.visible = _loc8_.enabled;
  3934.                }
  3935.                if(_loc6_.hit_mc != null)
  3936.                {
  3937.                   (_loc9_ = ctrlDataDict[_loc6_.hit_mc]).enabled = _loc6_.enabled;
  3938.                   _loc6_.hit_mc.visible = _loc9_.enabled;
  3939.                }
  3940.                _loc7_ = !flvplayback_internal::_bufferingBarHides || _loc6_.enabled || flvplayback_internal::controls[BUFFERING_BAR] == undefined || !flvplayback_internal::controls[BUFFERING_BAR].visible;
  3941.                _loc5_.visible = _loc7_;
  3942.                if(_loc6_.progress_mc != null)
  3943.                {
  3944.                   _loc6_.progress_mc.visible = _loc7_;
  3945.                   if((_loc10_ = ctrlDataDict[_loc6_.progress_mc]).fill_mc != null)
  3946.                   {
  3947.                      _loc10_.fill_mc.visible = _loc7_;
  3948.                   }
  3949.                }
  3950.                if(_loc6_.fullness_mc != null)
  3951.                {
  3952.                   _loc6_.fullness_mc.visible = _loc7_;
  3953.                   if((_loc11_ = ctrlDataDict[_loc6_.fullness_mc]).fill_mc != null)
  3954.                   {
  3955.                      _loc11_.fill_mc.visible = _loc7_;
  3956.                   }
  3957.                }
  3958.                break;
  3959.             case BUFFERING_BAR:
  3960.                switch(_loc4_)
  3961.                {
  3962.                   case VideoState.STOPPED:
  3963.                   case VideoState.PLAYING:
  3964.                   case VideoState.PAUSED:
  3965.                   case VideoState.REWINDING:
  3966.                   case VideoState.SEEKING:
  3967.                      _loc6_.enabled = false;
  3968.                      break;
  3969.                   default:
  3970.                      _loc6_.enabled = true;
  3971.                }
  3972.                _loc5_.visible = _loc6_.enabled;
  3973.                if(_loc6_.fill_mc != null)
  3974.                {
  3975.                   _loc6_.fill_mc.visible = _loc6_.enabled;
  3976.                }
  3977.                break;
  3978.             case PAUSE_BUTTON:
  3979.                switch(_loc4_)
  3980.                {
  3981.                   case VideoState.DISCONNECTED:
  3982.                   case VideoState.STOPPED:
  3983.                   case VideoState.PAUSED:
  3984.                   case VideoState.REWINDING:
  3985.                      _loc6_.enabled = false;
  3986.                      break;
  3987.                   case VideoState.PLAYING:
  3988.                      _loc6_.enabled = true;
  3989.                      break;
  3990.                   case VideoState.BUFFERING:
  3991.                      _loc6_.enabled = !flvplayback_internal::_bufferingBarHides || flvplayback_internal::controls[BUFFERING_BAR] == undefined;
  3992.                }
  3993.                if(flvplayback_internal::controls[PLAY_PAUSE_BUTTON] != undefined)
  3994.                {
  3995.                   _loc5_.visible = _loc6_.enabled;
  3996.                }
  3997.                break;
  3998.             case PLAY_BUTTON:
  3999.                switch(_loc4_)
  4000.                {
  4001.                   case VideoState.PLAYING:
  4002.                      _loc6_.enabled = false;
  4003.                      break;
  4004.                   case VideoState.STOPPED:
  4005.                   case VideoState.PAUSED:
  4006.                      _loc6_.enabled = true;
  4007.                      break;
  4008.                   case VideoState.BUFFERING:
  4009.                      _loc6_.enabled = !flvplayback_internal::_bufferingBarHides || flvplayback_internal::controls[BUFFERING_BAR] == undefined;
  4010.                }
  4011.                if(flvplayback_internal::controls[PLAY_PAUSE_BUTTON] != undefined)
  4012.                {
  4013.                   _loc5_.visible = !flvplayback_internal::controls[PAUSE_BUTTON].visible;
  4014.                }
  4015.                break;
  4016.             case STOP_BUTTON:
  4017.                switch(_loc4_)
  4018.                {
  4019.                   case VideoState.DISCONNECTED:
  4020.                   case VideoState.STOPPED:
  4021.                      _loc6_.enabled = false;
  4022.                      _loc5_.tabEnabled = false;
  4023.                      break;
  4024.                   case VideoState.PAUSED:
  4025.                   case VideoState.PLAYING:
  4026.                   case VideoState.BUFFERING:
  4027.                      _loc6_.enabled = true;
  4028.                      _loc5_.tabEnabled = true;
  4029.                }
  4030.                break;
  4031.             case BACK_BUTTON:
  4032.             case FORWARD_BUTTON:
  4033.                switch(_loc4_)
  4034.                {
  4035.                   case VideoState.BUFFERING:
  4036.                      _loc6_.enabled = !flvplayback_internal::_bufferingBarHides || flvplayback_internal::controls[BUFFERING_BAR] == undefined;
  4037.                      _loc5_.tabEnabled = !flvplayback_internal::_bufferingBarHides || flvplayback_internal::controls[BUFFERING_BAR] == undefined;
  4038.                }
  4039.          }
  4040.          _loc5_.mouseEnabled = _loc6_.enabled;
  4041.          flvplayback_internal::_vc.activeVideoPlayerIndex = _loc3_;
  4042.       }
  4043.       
  4044.       public function set fullScreenTakeOver(param1:Boolean) : void
  4045.       {
  4046.          var v:Boolean = param1;
  4047.          if(flvplayback_internal::_fullScreenTakeOver != v)
  4048.          {
  4049.             _fullScreenTakeOver = v;
  4050.             if(flvplayback_internal::_fullScreenTakeOver)
  4051.             {
  4052.                enterFullScreenTakeOver();
  4053.             }
  4054.             else
  4055.             {
  4056.                if(flvplayback_internal::_vc.stage != null && flvplayback_internal::_fullScreen && flvplayback_internal::_fullScreenAccel)
  4057.                {
  4058.                   try
  4059.                   {
  4060.                      flvplayback_internal::_vc.stage.displayState = StageDisplayState.NORMAL;
  4061.                   }
  4062.                   catch(se:SecurityError)
  4063.                   {
  4064.                   }
  4065.                }
  4066.                exitFullScreenTakeOver();
  4067.             }
  4068.          }
  4069.       }
  4070.       
  4071.       flvplayback_internal function enterFullScreenTakeOver() : void
  4072.       {
  4073.          var i:int = 0;
  4074.          var fullScreenBG:Sprite = null;
  4075.          var vp:VideoPlayer = null;
  4076.          if(!flvplayback_internal::_fullScreen || flvplayback_internal::cacheFLVPlaybackParent != null)
  4077.          {
  4078.             return;
  4079.          }
  4080.          flvplayback_internal::_vc.removeEventListener(LayoutEvent.LAYOUT,flvplayback_internal::handleLayoutEvent);
  4081.          flvplayback_internal::_vc.removeEventListener(AutoLayoutEvent.AUTO_LAYOUT,flvplayback_internal::handleLayoutEvent);
  4082.          flvplayback_internal::_vc.removeEventListener(Event.ADDED_TO_STAGE,flvplayback_internal::handleEvent);
  4083.          flvplayback_internal::_vc.stage.removeEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  4084.          try
  4085.          {
  4086.             cacheFLVPlaybackScaleMode = new Array();
  4087.             cacheFLVPlaybackAlign = new Array();
  4088.             i = 0;
  4089.             while(i < flvplayback_internal::_vc.videoPlayers.length)
  4090.             {
  4091.                vp = flvplayback_internal::_vc.videoPlayers[i] as VideoPlayer;
  4092.                if(vp != null)
  4093.                {
  4094.                   flvplayback_internal::cacheFLVPlaybackScaleMode[i] = vp.scaleMode;
  4095.                   flvplayback_internal::cacheFLVPlaybackAlign[i] = vp.align;
  4096.                }
  4097.                i++;
  4098.             }
  4099.             cacheFLVPlaybackParent = flvplayback_internal::_vc.parent;
  4100.             cacheFLVPlaybackIndex = flvplayback_internal::_vc.parent.getChildIndex(flvplayback_internal::_vc);
  4101.             cacheFLVPlaybackLocation = new Rectangle(flvplayback_internal::_vc.registrationX,flvplayback_internal::_vc.registrationY,flvplayback_internal::_vc.registrationWidth,flvplayback_internal::_vc.registrationHeight);
  4102.             if(!flvplayback_internal::_fullScreenAccel)
  4103.             {
  4104.                cacheStageAlign = flvplayback_internal::_vc.stage.align;
  4105.                cacheStageScaleMode = flvplayback_internal::_vc.stage.scaleMode;
  4106.                flvplayback_internal::_vc.stage.align = StageAlign.TOP_LEFT;
  4107.                flvplayback_internal::_vc.stage.scaleMode = StageScaleMode.NO_SCALE;
  4108.             }
  4109.             flvplayback_internal::_vc.align = VideoAlign.CENTER;
  4110.             flvplayback_internal::_vc.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
  4111.             flvplayback_internal::_vc.registrationX = 0;
  4112.             flvplayback_internal::_vc.registrationY = 0;
  4113.             flvplayback_internal::_vc.setSize(flvplayback_internal::_vc.stage.stageWidth,flvplayback_internal::_vc.stage.stageHeight);
  4114.             if(flvplayback_internal::_vc.stage != flvplayback_internal::_vc.parent)
  4115.             {
  4116.                flvplayback_internal::_vc.stage.addChild(flvplayback_internal::_vc);
  4117.             }
  4118.             else
  4119.             {
  4120.                flvplayback_internal::_vc.stage.setChildIndex(flvplayback_internal::_vc,flvplayback_internal::_vc.stage.numChildren - 1);
  4121.             }
  4122.             fullScreenBG = Sprite(flvplayback_internal::_vc.getChildByName("fullScreenBG"));
  4123.             if(fullScreenBG == null)
  4124.             {
  4125.                fullScreenBG = new Sprite();
  4126.                fullScreenBG.name = "fullScreenBG";
  4127.                flvplayback_internal::_vc.addChildAt(fullScreenBG,0);
  4128.             }
  4129.             else
  4130.             {
  4131.                flvplayback_internal::_vc.setChildIndex(fullScreenBG,0);
  4132.             }
  4133.             fullScreenBG.graphics.beginFill(flvplayback_internal::_fullScreenBgColor);
  4134.             fullScreenBG.graphics.drawRect(0,0,flvplayback_internal::_vc.stage.stageWidth,flvplayback_internal::_vc.stage.stageHeight);
  4135.             layoutSkin();
  4136.             setupSkinAutoHide(false);
  4137.             if(flvplayback_internal::hitTarget_mc != null)
  4138.             {
  4139.                flvplayback_internal::hitTarget_mc.graphics.clear();
  4140.                flvplayback_internal::hitTarget_mc.graphics.lineStyle(0,0,0);
  4141.                flvplayback_internal::hitTarget_mc.graphics.drawRect(0,0,flvplayback_internal::_vc.stage.stageWidth,flvplayback_internal::_vc.stage.stageHeight);
  4142.             }
  4143.          }
  4144.          catch(err:Error)
  4145.          {
  4146.             cacheFLVPlaybackParent = null;
  4147.          }
  4148.          flvplayback_internal::_vc.addEventListener(LayoutEvent.LAYOUT,flvplayback_internal::handleLayoutEvent);
  4149.          flvplayback_internal::_vc.addEventListener(AutoLayoutEvent.AUTO_LAYOUT,flvplayback_internal::handleLayoutEvent);
  4150.          flvplayback_internal::_vc.addEventListener(Event.ADDED_TO_STAGE,flvplayback_internal::handleEvent);
  4151.          flvplayback_internal::_vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN,flvplayback_internal::handleFullScreenEvent);
  4152.       }
  4153.       
  4154.       public function set seekBarScrubTolerance(param1:Number) : void
  4155.       {
  4156.          _seekBarScrubTolerance = param1;
  4157.       }
  4158.       
  4159.       flvplayback_internal function cleanupHandle(param1:Object) : void
  4160.       {
  4161.          var e:Event = null;
  4162.          var ctrl:Sprite = null;
  4163.          var ctrlData:ControlData = null;
  4164.          var ctrlOrEvent:Object = param1;
  4165.          try
  4166.          {
  4167.             if(ctrlOrEvent is Event)
  4168.             {
  4169.                e = Event(ctrlOrEvent);
  4170.             }
  4171.             ctrl = e == null ? Sprite(ctrlOrEvent) : Sprite(e.currentTarget);
  4172.             ctrlData = ctrlDataDict[ctrl];
  4173.             if(ctrlData == null || e == null)
  4174.             {
  4175.                ctrl.removeEventListener(Event.REMOVED_FROM_STAGE,flvplayback_internal::cleanupHandle,false);
  4176.                if(ctrlData == null)
  4177.                {
  4178.                   return;
  4179.                }
  4180.             }
  4181.             ctrl.removeEventListener(Event.ENTER_FRAME,flvplayback_internal::finishAddBarControl);
  4182.             if(ctrlData.handle_mc != null)
  4183.             {
  4184.                if(ctrlData.handle_mc.parent != null)
  4185.                {
  4186.                   ctrlData.handle_mc.parent.removeChild(ctrlData.handle_mc);
  4187.                }
  4188.                delete ctrlDataDict[ctrlData.handle_mc];
  4189.                ctrlData.handle_mc = null;
  4190.             }
  4191.             if(ctrlData.hit_mc != null)
  4192.             {
  4193.                if(ctrlData.hit_mc.parent != null)
  4194.                {
  4195.                   ctrlData.hit_mc.parent.removeChild(ctrlData.hit_mc);
  4196.                }
  4197.                delete ctrlDataDict[ctrlData.hit_mc];
  4198.                ctrlData.hit_mc = null;
  4199.             }
  4200.          }
  4201.          catch(err:Error)
  4202.          {
  4203.          }
  4204.       }
  4205.       
  4206.       flvplayback_internal function assignTabIndexes(param1:int) : int
  4207.       {
  4208.          var controlsSlice:Array = null;
  4209.          var customSlice:Array = null;
  4210.          var sortedControls:Array = null;
  4211.          var i:int = 0;
  4212.          var ctrl:Sprite = null;
  4213.          var startTabbing:int = param1;
  4214.          if(startTabbing)
  4215.          {
  4216.             startTabIndex = startTabbing;
  4217.             endTabIndex = flvplayback_internal::startTabIndex + 1;
  4218.          }
  4219.          else
  4220.          {
  4221.             if(!flvplayback_internal::_vc.tabIndex)
  4222.             {
  4223.                return flvplayback_internal::endTabIndex;
  4224.             }
  4225.             startTabIndex = flvplayback_internal::_vc.tabIndex;
  4226.             endTabIndex = flvplayback_internal::startTabIndex + 1;
  4227.          }
  4228.          var sortByPosition:Function = function(param1:DisplayObject, param2:DisplayObject):int
  4229.          {
  4230.             var _loc3_:Rectangle = param1.getBounds(flvplayback_internal::_vc);
  4231.             var _loc4_:Rectangle = param2.getBounds(flvplayback_internal::_vc);
  4232.             if(_loc3_.x > _loc4_.x)
  4233.             {
  4234.                return 1;
  4235.             }
  4236.             if(_loc3_.x < _loc4_.x)
  4237.             {
  4238.                return -1;
  4239.             }
  4240.             if(_loc3_.y > _loc4_.y)
  4241.             {
  4242.                return -1;
  4243.             }
  4244.             if(_loc3_.y < _loc4_.y)
  4245.             {
  4246.                return 1;
  4247.             }
  4248.             return 0;
  4249.          };
  4250.          try
  4251.          {
  4252.             controlsSlice = flvplayback_internal::controls.slice();
  4253.             if(customClips && customClips.length > 0)
  4254.             {
  4255.                customSlice = customClips.slice();
  4256.             }
  4257.             sortedControls = !customSlice ? controlsSlice : controlsSlice.concat(customSlice);
  4258.             sortedControls.sort(sortByPosition);
  4259.             while(i < sortedControls.length)
  4260.             {
  4261.                ctrl = sortedControls[i] as Sprite;
  4262.                ctrl.tabIndex = ++endTabIndex;
  4263.                if(!ctrl.tabEnabled)
  4264.                {
  4265.                   ctrl.tabEnabled = false;
  4266.                }
  4267.                i++;
  4268.             }
  4269.          }
  4270.          catch(err:Error)
  4271.          {
  4272.          }
  4273.          return ++endTabIndex;
  4274.       }
  4275.    }
  4276. }
  4277.